The gray code is a binary numeral system where
two successive values differ in only one bit.Given a non-negative
integernrepresenting the total number...
分类:
其他好文 时间:
2014-06-10 00:01:38
阅读次数:
392
Given two integersnandk, return all possible
combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution
is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-06-08 08:08:29
阅读次数:
294
PathsumDescription:Given a binary tree and a
sum, determine if the tree has a root-to-leaf path such that adding up all the
values along the path equa...
分类:
其他好文 时间:
2014-06-08 01:11:46
阅读次数:
395
给定两个数m,n,其中m是一个素数。 将n(0=n) { sum+=m/n m=m/n; }
分类:
其他好文 时间:
2014-06-08 00:20:05
阅读次数:
348
Givennnon-negative integersa1,a2, ...,an, where
each represents a point at coordinate (i,ai).nvertical lines are drawn such that
the two endpoints of ...
分类:
其他好文 时间:
2014-06-07 23:03:35
阅读次数:
279
可变参数可变参数可以当成一个数组使用public void sum(int ...nums){
int sum = 0; for(int i:nums) { sum +=i; } System.out.pri...
分类:
编程语言 时间:
2014-06-07 22:42:41
阅读次数:
306
题目链接 Given a m x n grid filled with non-negative
numbers, find a path from top left to bottom right which minimizes the sum of
all numbers along its p...
分类:
其他好文 时间:
2014-06-07 21:59:08
阅读次数:
344
a题,就不说了吧b题,直接从大到小排序1-limit的所有数的lowbit,再从大到小贪心组成sum就行了 1 #include 2 #include 3
#include 4 #include 5 #define N 200000 6 using namespace std; ...
分类:
其他好文 时间:
2014-06-07 21:49:57
阅读次数:
272
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-07 20:22:17
阅读次数:
264
Given a binary tree and a sum, determine if the
tree has a root-to-leaf path such that adding up all the values along the path
equals the given sum.Fo...
分类:
其他好文 时间:
2014-06-07 16:55:09
阅读次数:
173