码迷,mamicode.com
首页 >  
搜索关键字:two sum    ( 31846个结果
算法 计算多个顺序区间的总长
List list = Arrays.asList(new Point(1, 5), new Point(2, 3),new Point(2, 8), new Point(9, 13));int sum = list.get(0).y - list.get(0).x,currenty=list.ge...
分类:其他好文   时间:2014-06-28 19:25:36    阅读次数:183
【leetcode】Minimum Path Sum
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:其他好文   时间:2014-06-28 15:55:58    阅读次数:196
LeetCode: Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-06-28 14:31:12    阅读次数:201
POJ 1155
很久以前做的树形DP题,今天再遇到时,竟然不会了,所以写写。。设数组:prf[MAX][MAX],cost[MAX],sum[MAX]。分别表示,在第i个结点为根的子树内的情况下,若有j个用户申请看电视,所能得到的最大费用。cost表示传送到i点时所花的费用,而sum表示当前结点为根的子树内已访问的...
分类:其他好文   时间:2014-06-28 14:28:23    阅读次数:293
SQL基础语法等
--1、while循环declare @sum intdeclare @i intset @i=1set @sum=0while(@i90) print @iendprint @sum--2、goto语句declare @num intset @num=100flag:print @numsel.....
分类:数据库   时间:2014-06-28 13:30:20    阅读次数:267
函数指针
函数指针是指向函数的指针变量。每一个函数都有一个入口地址,该入口地址就是函数指针所指向的地址。有了指向函数的指针后,可用该指针变量调用函数。函数指针有两个用途:调用函数和做函数的参数。(1)函数指针的声明方法为:函数类型 (标志符指针变量名名) (形参列表);int sum(int a, in...
分类:其他好文   时间:2014-06-28 13:28:18    阅读次数:154
iOS学习笔记---c语言第十一天
函数指针一、函数指针定义//函数声明:声明我是一个什么函数//求两个数的和//函数的类型:int (int x,int y)//即:我是一个返回值为整型,有两个整型参数的函数。//函数名是 sumint sum(int x,int y);函数指针定义p是变量,其他是类型(通常没有形参a,b)//函数...
分类:移动开发   时间:2014-06-28 13:03:58    阅读次数:295
[再寄小读者之数学篇](2014-06-20 Beta 函数)
令 $\dps{B(m,n)=\sum_{k=0}^n C_n^k \cfrac{(-1)^k}{m+k+1}}$, $m,n\in\bbN^+$. (1) 证明 $B(m,n)=B(n,m)$; (2) 计算 $B(m,n)$. 证明: (1) $$\beex \bea B(m,n)&=\sum_...
分类:其他好文   时间:2014-06-28 12:55:39    阅读次数:182
HDU 4745 Two Rabbits(DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4745题意:n个数排成一个环。两个人AB初始时各自选定一个位置。每一轮A在顺时针方向选择一个位置,B在逆时针选择一个位置,且这两个人所选位置的数字相等,然后格子跳到新选的位置上。问最多进行多少轮?有一个限...
分类:其他好文   时间:2014-06-23 08:15:51    阅读次数:262
UVALive 5075 Intersection of Two Prisms(柱体体积交)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3076题意:给出两个柱体,一个平行于z轴,设这个截面为A,在XOY面,一个平行于y...
分类:其他好文   时间:2014-06-23 07:04:32    阅读次数:311
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!