码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
BZOJ 3155: Preprefix sum
大意:给一个数组,先求出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
LeetCode:Triangle
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
[leetcode] Median of Two Sorted Arrays
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
[leetcode] Two Sum
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
[leetcode] Combination Sum II
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
[leetcode] Divide Two Integers
Divide two integers without using multiplication, division and mod operator.
分类:其他好文   时间:2014-06-27 12:50:12    阅读次数:253
[leetcode] Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.
分类:其他好文   时间:2014-06-27 12:42:55    阅读次数:198
[leetcode] Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.
分类:其他好文   时间:2014-06-27 12:38:25    阅读次数:169
[leetcode] 3Sum
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!