码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
zoj 1608 Two Circles and a Rectangle 判断两个圆是否能放入一个矩形中
题目来源:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=608分析:两个圆放到矩形的临界点图为:其中a为长, b为宽, r1 > r2红色三角形的三边长分别为:x = a - (r1 +r2)y = b - (r1 + r2)z...
分类:其他好文   时间:2014-05-08 14:17:58    阅读次数:377
bzoj 3437 斜率优化DP
写题解之前首先要感谢妹子。 比较容易的斜率DP,设sum[i]=Σb[j],sum_[i]=Σb[j]*j,w[i]为第i个建立,前i个的代价。 那么就可以转移了。 备注:还是要感谢妹子。/**************************************************...
分类:其他好文   时间:2014-05-08 10:24:20    阅读次数:260
Leetcode: Roman to Integer
一次通过: 1 public class Solution { 2 public int romanToInt(String s) { 3 int sum = 0; 4 int[] num = new int[s.length()]; 5 if...
分类:其他好文   时间:2014-05-08 08:24:26    阅读次数:233
Leetcode | Two Sum
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 nu...
分类:其他好文   时间:2014-05-08 06:33:29    阅读次数:339
POJ2406Power Strings
来源:http://poj.org/problem?id=2406  Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 30293   Accepted: 12631 Description Given two strin...
分类:其他好文   时间:2014-05-08 02:03:40    阅读次数:337
连续子序列最大和问题的四种经典解答
问题描述         给定(可能是负的)整数序列A1, A2,...,AN, 寻找(并标识)使Sum(Ak)(k >=i, k <= j)的值最大的序列。如果所有的整数都是负的,那么连续子序列的最大和是零。...
分类:其他好文   时间:2014-05-08 01:49:14    阅读次数:273
POJ 1775 sum of Factorial (数论)
链接:http://poj.org/problem?id=1775 Description John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a Hungarian-American mathematician who made important contributions to the foundations of m...
分类:其他好文   时间:2014-05-07 23:57:32    阅读次数:402
Sum square difference
简单:e sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385The square of the sum of the first ten natural numbers is,(1 + 2 ...
分类:其他好文   时间:2014-05-07 20:23:43    阅读次数:338
LeetCode:Maximum Subarray
题目链接 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [?2,1,?3,4,...
分类:其他好文   时间:2014-05-07 16:42:42    阅读次数:287
搜索(DFS)
Sum It UpTime Limit:1000MSMemory Limit:10000KTotal Submissions:5684Accepted:2894DescriptionGiven a specified total t and a list of n integers, find al...
分类:其他好文   时间:2014-05-07 10:45:02    阅读次数:388
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!