Given amxngrid filled with non-negative
numbers, find a path from top left to bottom right whichminimizesthe sum of all
numbers along its path.Note:Yo...
分类:
其他好文 时间:
2014-06-04 20:57:08
阅读次数:
360
简单深搜,可以完全暴力,不会超时的。#include#include#includeusing
namespace std;#define MAX(a,b) (a>b?a:b) char maze[10][10];int n, maxn;void
DFS(int step,int count);in...
分类:
Web程序 时间:
2014-06-04 20:43:04
阅读次数:
270
Given a collection of candidate numbers (C) and
a target number (T), find all unique combinations inCwhere the candidate numbers
sums toT.Each number ...
分类:
其他好文 时间:
2014-06-04 20:14:25
阅读次数:
287
Find the contiguous subarray within an array
(containing at least one number) which has the largest sum.For example, given
the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-06-04 19:30:13
阅读次数:
230
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".classSolution{public:stringaddBinary(stringa,st...
分类:
其他好文 时间:
2014-06-04 19:23:09
阅读次数:
235
1/******************2byzhuyuqi*3QQ:1113865149*4name:2-sat*5*6******************/78usingnamespacestd;9constintMAX=1000;10intr[MAX],*rank;11intwa[MAX],w...
分类:
其他好文 时间:
2014-06-03 11:38:57
阅读次数:
194
算法入门经典训练指南88页练习::这道题只要把原矩阵扩大4倍,那么其跟最大子矩阵的题目就很类似,把二维转化成一维,求最大的序列和,不过这个序列的长度不能超过n。长度不能超过n?
那这道题又跟hdu 3415HDU 3415 Max Sum of Max-K-sub-sequence (单调队列) 1...
分类:
其他好文 时间:
2014-05-30 18:14:46
阅读次数:
471
Given a binary tree containing digits
from0-9only, each root-to-leaf path could represent a number.An example is the
root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-05-30 16:32:52
阅读次数:
226
Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight line./** * Definition for a
point. * struct Point { * ...
分类:
其他好文 时间:
2014-05-30 16:27:19
阅读次数:
238
Given a binary tree, find the maximum path
sum.The path may start and end at any node in the tree.For example:Given the
below binary tree, 1 ...
分类:
其他好文 时间:
2014-05-30 16:10:54
阅读次数:
185