码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
18位身份证号验证及信息获取
止乎于分享!IDCode18 = { validate: function (value) { if (value.length != 18) return false; var value = value.toLowerCase(); var sum...
分类:其他好文   时间:2014-07-19 16:24:38    阅读次数:230
LeetCode Maximum Subarray
class Solution {public: int maxSubArray(int A[], int n) { int cur_sum = 0; int max_sum = INT_MIN; for (int i=0; i max_...
分类:其他好文   时间:2014-07-19 15:18:15    阅读次数:160
URAL 1877 Bicycle Codes
1877. Bicycle CodesTime limit: 0.5 secondMemory limit: 64 MBDen has two four-digit combination locks for protecting his bicycle from thieves. Every ev...
分类:其他好文   时间:2014-07-19 15:02:20    阅读次数:313
[YZOJ1579]&&[BZOJ2450]arr
Description 给出3*n个数xi,要求构造三个长度为n的序列ai,bi,ci,使得满足下列条件: 1到3*n的每个数都在三个序列中的某个出现一次且仅一次; S=sum((x[ai]-x[bi])*x[ci])最大。 输出最大的S。多组数据。Input Format 第一行...
分类:其他好文   时间:2014-07-19 14:39:18    阅读次数:214
Box Game
There are two identical boxes. One of them contains n balls, while the other box contains one ball. Alice and Bob invented a game with the boxes and b...
分类:其他好文   时间:2014-07-19 14:25:51    阅读次数:228
Uva 12889 One-Two-Three
Your little brother has just learnt to write one, two and three, in English. He has written a lot of those words in a paper, your task is to recognize...
分类:其他好文   时间:2014-07-19 09:31:41    阅读次数:238
GCD SUM 强大的数论,容斥定理
GCD SUMTime Limit:8000/4000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatusProblem Description给出N,M执行如下程序:long long ans = 0,ansx ...
分类:其他好文   时间:2014-07-19 09:15:30    阅读次数:234
HDU 1003 Max Sum
Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5...
分类:其他好文   时间:2014-07-19 08:25:40    阅读次数:224
UVA 10090 Marbles(扩展欧几里得)
Marbles Input: standard input Output: standard output I have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. The boxes are of two types: Type 1: each ...
分类:其他好文   时间:2014-07-19 08:01:10    阅读次数:264
USACO Section 2.1 Sorting a Three-Valued Sequence
/* ID: lucien23 PROG: sort3 LANG: C++ */ #include #include #include #include using namespace std; void exchange(int nums[], int begin, int end, int N, int x); int sum = 0; int main() { ifstream ...
分类:其他好文   时间:2014-07-19 02:12:25    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!