Counting
The Problem
Gustavo knows how to count, but he is now learning how write numbers. As he is a very good student, he already learned 1, 2, 3 and 4. But he didn't realize yet tha...
分类:
其他好文 时间:
2014-07-18 22:04:36
阅读次数:
322
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol...
分类:
其他好文 时间:
2014-07-17 14:03:41
阅读次数:
293
Description
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of...
分类:
其他好文 时间:
2014-07-17 10:12:16
阅读次数:
191
A typical DFS usage, no big deal:class Solution {public: int dfs(TreeNode *p, int pval) { if( !p->left && !p->right ) { ...
分类:
其他好文 时间:
2014-07-17 09:55:25
阅读次数:
171
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string;{ //string就是此时输入的那个字符text...
分类:
其他好文 时间:
2014-07-17 00:50:17
阅读次数:
354
There are N integers (1A[j].InputThe first line of the input contains the number N. The second line contains N numbers A1...AN.OutputWrite amount of s...
分类:
其他好文 时间:
2014-07-17 00:24:27
阅读次数:
236
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2014-07-16 18:20:59
阅读次数:
155
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],
[1,4],
]...
分类:
其他好文 时间:
2014-07-16 17:27:32
阅读次数:
139
In mathematical terms, the sequenceFnof Fibonacci numbers is defined by the recurrence relationF1?=?1;F2?=?1;Fn?=?Fn?-?1?+?Fn?-?2(n?>?2).DZY loves Fib...
分类:
其他好文 时间:
2014-07-16 16:45:19
阅读次数:
418
No matter left shift or right shift, the result's sign should always be the same as its left operand.
By default, const numbers in C/C++ is signed.
-Wsign-compare
{
unsigned int j = 3;
...
分类:
其他好文 时间:
2014-07-16 12:59:21
阅读次数:
238