码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
006:欧拉项目平方和与和的平方的差
Sum square difference Problem 6 The sum of the squares of the first ten natural numbers is, 12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ....
分类:其他好文   时间:2014-05-23 02:22:57    阅读次数:193
hdu 4825 Xor Sum(字典树)
题目链接:hdu 4825 Xor Sum 题目大意:中文题。 解题思路:将给定得数按照二进制建成一颗字典树,每一层分别对应的各个位数上的01状态。然后每一次查询,如果对应位置为0,则要往1的方向走,如果是1,则要往0的方向走。但是要注意,走的前提是对应分支是存在的。 #include #include #include using namespace std; //type...
分类:其他好文   时间:2014-05-23 02:15:15    阅读次数:286
hdu 2576 Another Sum Problem
数学推导题,f(n)=n*(n+1)*(n+2)/6 推导思路如下: #include"cstdio" #include"cstring" #include"cmath" #include"cstdlib" #include"iostream" #include"algorithm" #include"queue" using namespace std; int main()...
分类:其他好文   时间:2014-05-23 02:13:15    阅读次数:269
001. 3和5的倍数
Problem 1: Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multip...
分类:其他好文   时间:2014-05-23 01:43:01    阅读次数:253
【leetcode】Max Points on a Line
题目:给定二维坐标上的若干点,找出这样一条线,属于该线的点数最多,返回点数。 分析:两个点确定了一条直线。共线,说明斜率相同。那么确定一个点A,该点与其他的点就会生成不同的斜率。这些斜率中,会存在相同的,那么这些相同的斜率就说明他们跟A在同一条直线上。 这里我们把斜率分成两种,一种是正常的斜率,就是可以写成 y = kx + b形式的k;一种就是横坐标相同,纵坐标不相同的,这时的斜率为无穷大。...
分类:其他好文   时间:2014-05-23 00:43:16    阅读次数:301
51系列小型操作系统精髓 简单实现7 C语言版待改进
#include "STC12C5A.H" #define TIMER_RELOAD()  {TL0=0x00;TH0=0xC4;}//使能T/C  初始10ms #define MAX_TASKS 2 //任务槽最大个数. unsigned char idata task_stack[MAX_TASKS][2];//任务堆栈.  PC指针为16位,需2个字节task_st...
分类:编程语言   时间:2014-05-23 00:03:19    阅读次数:341
ORA-27100 shared memory realm already exists错误解决方法
环境:win 2003   + oracle 10g             win 2003服务器物理内存4G             oracle10g SGA             1504M 事故背景: 调整SGA大小,因为OS的内存只有4G,建议SGA的大小不要超过60%,我调整为2G  SQL> alter systemset sga_max_size=2000m ...
分类:其他好文   时间:2014-05-22 23:46:00    阅读次数:430
hdu 3496 Watch The Movie
题目:     链接:点击打开链接 题意:     想看n个电影,只能从中选m个,用l时间来看,这n个电影都要花费时间a[i]去看,也有一定的价值b[i],选取最大的价值。 思路:     这是二维费用背包,总时间l是背包容量,选m个是隐藏的花费,每个电影需要的时间a[i]也是花费。这样,状态转移方程就有了:dp[i][j] = max( dp[i][j] , dp[i-1][j-a[i...
分类:其他好文   时间:2014-05-22 23:25:03    阅读次数:335
POJ 1191 棋盘分割
刷了这么长时间POJ了   可算看到了一个中文题,不容易啊~~。 题目大意:自己看。 解题思路: dp[x1][y1][x2][y2][num]代表从(x1,y1)到(x2,y2)分成num+1块最小的平方和是多少。 下面是代码: #include #include #include int sum[10][10],board[10][10]; d...
分类:其他好文   时间:2014-05-22 23:06:07    阅读次数:300
求数组元素的最大值最小值
这是编程之美上的一个题目: 一般的做法: void main() { int a[5]={78,63,78,67,18}; int min=0,max=0; min=max=a[0]; for(int i=0;ia[i]) min=a[i]; if(max<a[i]) max=a[i]; }...
分类:其他好文   时间:2014-05-22 17:04:23    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!