码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
HDOJ 1001 Sum Problem
Sum Problem Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 275913    Accepted Submission(s): 68867 Problem Description Hey, welcome...
分类:其他好文   时间:2014-07-22 00:27:36    阅读次数:167
一个复平面上的不等式
设$z_{1},\cdots,z_{N}\in\mathbb C$,证明存在$\{1,2,\cdots,N\}$的子集$S$使得$$\left|\sum_{k\in S}z_{k}\right|\geq\frac{1}{\pi}\sum_{k=1}^{N}|z_{k}.|$$证明 设$z_{k}=....
分类:其他好文   时间:2014-07-22 00:25:34    阅读次数:235
POJ 1845 Sumdiv
Sumdiv Description Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901). Input The only line...
分类:其他好文   时间:2014-07-21 16:27:12    阅读次数:187
hdu 3473 Minimum Sum
题意: 一段固定不变的数字  m次询问  每次询问选择一个x值  使得区间[l,r]中每个元素与x的差的绝对值的和最小 思路: x值明显选择[l,r]中数字的中位数  那么题目就变成了[l,r]中第(r-l+1+1)/2小的数是几  由于数字是静态的  所以划分树可解 那么ans = num(x) - num(>x) * x  由于sum之间可由前缀和相互求出  num也可以通过...
分类:其他好文   时间:2014-07-21 16:16:12    阅读次数:263
LeetCode:Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:其他好文   时间:2014-07-21 14:35:26    阅读次数:206
Codeforces 229D
一 题意描述:有n(1=last[j]}三 源码展示: 1 #include 2 int dp[5010],sum[5010],last[5010]; 3 int main() 4 { 5 int n; 6 scanf("%d",&n); 7 memset(sum,0,si...
分类:其他好文   时间:2014-07-21 14:30:46    阅读次数:206
LeetCode_39combinationSum2 [Combination Sum II]
#pragma warning(disable:4996) #include <Windows.h> #include <tchar.h> #include <cstdio> #include <vector> using namespace std; /* submit time : 3 1. Runtime Error Last executed input: [5,3]...
分类:其他好文   时间:2014-07-21 13:26:03    阅读次数:250
c语言数组问题解析
#import<Foundation/Foundation.h>#defineCOUNT10intmain(intargc,constchar*argv[]){//1、随机产生20个[10,50]的正整数存到数组中,并求数组中的所有元素最大值、最小值、平均值以及各元素之和。第二大值。//intmax=0,min=0,sum=0,secondMax=0;//floatave=0.0;//inta[20..
分类:编程语言   时间:2014-07-21 12:25:35    阅读次数:352
LeetCode "Merge Two Sorted Lists"
Simply care about the boundary cases:class Solution {public: ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) { if (l1 && !l2) return l1;...
分类:其他好文   时间:2014-07-21 11:07:04    阅读次数:206
js基础知识总结:函数
函数内部的属性:arguments 和this是函数内部的两个特殊对象arguments:function recursion(num){ if(numfunction box(num1,num2){ return num1+num2;}//可以使用这种方式将sum函数转换成 box方法...
分类:Web程序   时间:2014-07-21 08:03:31    阅读次数:260
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!