大意:给一个数组,先求出SUM[I],然后动态的求出1-I的SUM[I]的和, 这题得化公式: 树状数组维护两个和:SUM(A[I])(1#include#include#includeusing namespace std;typedef long long ll;const int N=...
分类:
其他好文 时间:
2014-06-27 17:53:38
阅读次数:
141
Given a triangle, find the minimum path sum from top to bottom. Each step you maymove to adjacent numbers on the row below.For example, given the fol....
分类:
其他好文 时间:
2014-06-27 16:29:58
阅读次数:
188
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)#include using namespace std;const int MAX = 1000000;int getResu(int n){ int sum=0; int temp= 1; for(int i=1; i >n) {...
分类:
其他好文 时间:
2014-06-27 13:47:37
阅读次数:
161
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2014-06-27 13:03:49
阅读次数:
136
Given an array of integers, find two numbers such that they add up to a specific target number.
分类:
其他好文 时间:
2014-06-27 12:59:50
阅读次数:
176
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.
分类:
其他好文 时间:
2014-06-27 12:52:03
阅读次数:
213
Divide two integers without using multiplication, division and mod operator.
分类:
其他好文 时间:
2014-06-27 12:50:12
阅读次数:
253
Given a linked list, swap every two adjacent nodes and return its head.
分类:
其他好文 时间:
2014-06-27 12:42:55
阅读次数:
198
Given two numbers represented as strings, return multiplication of the numbers as a string.
分类:
其他好文 时间:
2014-06-27 12:38:25
阅读次数:
169
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of ...
分类:
其他好文 时间:
2014-06-27 12:27:28
阅读次数:
169