Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, whe...
分类:
其他好文 时间:
2014-10-26 17:04:21
阅读次数:
193
A message containing letters from A-Z is being encoded to numbers using the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total numb...
分类:
其他好文 时间:
2014-10-26 17:04:00
阅读次数:
194
【题目】
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it...
分类:
其他好文 时间:
2014-10-26 14:21:29
阅读次数:
243
Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, ...
分类:
其他好文 时间:
2014-10-26 11:40:45
阅读次数:
111
题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each numb...
分类:
其他好文 时间:
2014-10-26 06:43:06
阅读次数:
171
题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated ...
分类:
其他好文 时间:
2014-10-25 22:50:47
阅读次数:
267
题目:将数字数转化成数字加单词的表示形式输出。
分析:数论,简单题。直接分成两部分除10000000的商和余数,分别输出即可。
说明:注意输入为数字0的情况,还有long long类型防止溢出。
#include
#include
#include
using namespace std;
void output(long long a)
{
if (a >= 10000...
分类:
其他好文 时间:
2014-10-25 18:46:48
阅读次数:
175
数位DP。。。。Palindromic NumbersTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %llu[Submit] [Go Back] [Status]DescriptionA palindromic number ...
分类:
其他好文 时间:
2014-10-25 17:13:44
阅读次数:
233
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
Each number in C may only be used once in the combina...
分类:
其他好文 时间:
2014-10-25 14:34:02
阅读次数:
163
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where
the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited numb...
分类:
其他好文 时间:
2014-10-25 11:56:08
阅读次数:
206