码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
[leetcode]Binary Tree Maximum Path Sum
Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be...
分类:其他好文   时间:2014-08-11 21:13:02    阅读次数:219
hdu 1069
1 //Accepted 264 KB 0 ms 2 //每种block只有三种方法,且每种放法至多放一次 3 //规定三条边的顺序后 4 //把所有的block按x递增排序,x相同则按y递增排序 5 //然后dp 6 //dp[i]=max(dp[i],dp[j]+height[i]...
分类:其他好文   时间:2014-08-11 20:43:32    阅读次数:208
56.一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?
#includeusing namespace std;int main(){ float sum=0;//注意声明成浮点型 float n=100.0; for(int i=1;i<=10;i++) { sum+=n; n=n*0.5; }...
分类:其他好文   时间:2014-08-11 20:26:52    阅读次数:294
POJ 1458 LCS模板
LCS模板 存一个 #include "stdio.h" #include "string.h" int main() { char a[1010],b[1010]; int i,j,Max,dp[1010]; while (scanf("%s",a)!=EOF) { scanf("%s",b); memset(dp,0,s...
分类:其他好文   时间:2014-08-11 18:05:22    阅读次数:220
mysql数据库性能参数配置(转)
max_connections MySql的最大连接数,如果服务器的并发连接请求量比较大,建议调高此值,以增加并行连接数量,当然这建立在机器能支撑的情况下,因为如果连接数越多,MySql会为每个连接提供连接缓冲区,就会开销越多的内存,连接数太大,服务器消耗的内存越多,以至于影响服务器性能,所以要根据服务器的配置适当调整该值,不能盲目提高设值。可以过'conn%'通配符查看当前状态的连接数量,以定...
分类:数据库   时间:2014-08-11 17:53:42    阅读次数:377
杭电 2710(水题)
Max Factor Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3693    Accepted Submission(s): 1181 Problem Description To improve the or...
分类:其他好文   时间:2014-08-11 17:52:32    阅读次数:245
55.输入两个正整数m和n,求其最大公约数和最小公倍数
#includeusing namespace std;int main(){ int m,n,Max; int temp1,temp2; cout>m>>n; Max=(m>n)?m:n; for(int i=1;i<Max;i++) { if(m...
分类:其他好文   时间:2014-08-11 17:44:52    阅读次数:186
HDU 4825 Xor Sum(二进制的字典树,数组模拟)
题目//居然可以用字典树。。。//用cin,cout等输入输出会超时//这是从别处复制来的#include#include#includeusing namespace std;int node[3011111][2];int tag,m,n,cas=0,T;long long one[64],al...
分类:其他好文   时间:2014-08-11 17:34:52    阅读次数:286
无序关联容器(C++11)
2012-11-27 15:22 张海龙/袁国忠 译 人民邮电出版社 字号:T|T《C++Primer Plus(第6版)(中文版)》附录G标准模板库方法和函数:本附录总结了STL容器方法和通用的STL算法函数。本节为大家介绍无序关联容器(C++11)。AD:G.4 无序关联容器(C++11)前面说...
分类:编程语言   时间:2014-08-11 17:27:02    阅读次数:797
分数求和
import java.util.Scanner;public class Sum { public static void main(String[] args){ Scanner input = new Scanner(System.in); System.ou...
分类:其他好文   时间:2014-08-11 17:13:42    阅读次数:218
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!