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-06-09 23:14:45
阅读次数:
264
【题目】
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 following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to...
分类:
其他好文 时间:
2014-06-08 17:52:45
阅读次数:
235
Find the contiguous subarray within an array (containing at least one number) which has the largest sum....
分类:
其他好文 时间:
2014-06-08 15:54:08
阅读次数:
258
题目来源:Light OJ 1278 Sum of Consecutive Integers
题意:N拆分成连续整数和的方案数
思路:奇因数的个数
#include
#include
#include
#include
using namespace std;
//筛素数
const int maxn = 10000010;
bool vis[maxn];
int prime[10...
分类:
其他好文 时间:
2014-06-08 15:34:09
阅读次数:
295
题目
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Cou...
分类:
其他好文 时间:
2014-06-08 15:32:45
阅读次数:
245
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 as a link...
分类:
其他好文 时间:
2014-06-08 15:30:28
阅读次数:
227
先上写干货,几个开源网站:
github.com
launchpad.netgitorious.orgsourceforge.netfreecode.com
今天介绍一下python函数和文件读写的知识。
函数
def print_two(*args):#That tells Python to take all the arguments to the function a...
分类:
编程语言 时间:
2014-06-08 10:37:23
阅读次数:
277
const int maxn = 100010;
int n, m;
vector G[maxn*2];
bool mark[maxn*2];
int S[maxn*2], c;
int a[maxn], b[maxn], sum;
bool dfs(int x)
{
if(mark[x^1])
return false;
if(mark[x])
return true;
mark...
分类:
其他好文 时间:
2014-06-08 10:31:01
阅读次数:
198
HDU1002--A + B Problem II...
分类:
其他好文 时间:
2014-06-08 04:56:06
阅读次数:
242
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-06-08 02:12:04
阅读次数:
216