码迷,mamicode.com
首页 >  
搜索关键字:hdu 1003 max sum    ( 72499个结果
hdu 4143 A Simple Problem (变形)
题目题意:给n,求x;直接枚举肯定超时, 把给的式子变形, (y+x)(y-x) = n;令y-x = b, y+x = a;枚举b, b 的范围肯定是sqrt(n), y = (a+b)/2; x = (a-b)/2;b越大, x越小, 所以倒着枚举b 1 #include 2 #include....
分类:其他好文   时间:2014-05-05 11:01:25    阅读次数:244
程序记录2(设置MapID)
try{ INIT_PLUG I_MongoDB* i = NEW(MongoDB); /*【注】 若自定义错误消息的数组长度必需指定为MAX_ERROR_SIZE*/ //char errmsg[MAX_ERROR_SIZE]={0};//方式一 ...
分类:Windows程序   时间:2014-05-05 10:54:13    阅读次数:459
hdu 1598 find the most comfortable road
http://acm.hdu.edu.cn/showproblem.php?pid=1598 1 #include 2 #include 3 #include 4 #define maxn 2000 5 using namespace std; 6 const int inf=1<<30; 7...
分类:其他好文   时间:2014-05-05 10:53:38    阅读次数:344
hdu 1599 find the mincost route
http://acm.hdu.edu.cn/showproblem.php?pid=1599floyd找最小环。 1 #include 2 #include 3 #include 4 #define maxn 200 5 using namespace std; 6 const int inf...
分类:其他好文   时间:2014-05-05 10:52:15    阅读次数:315
549565
$\bf命题2:$设$f\left( x \right) \in C\left( { - \infty , + \infty } \right)$,令\[{f_n}\left( x \right) = \sum\limits_{k = 0}^{n - 1} {\frac{1}{n}} f\left(...
分类:其他好文   时间:2014-05-04 19:12:48    阅读次数:361
68
$\bf命题1:$设正项级数$\sum\limits_{n = 1}^\infty {{a_n}} $发散,且${s_n} = \sum\limits_{k = 1}^n {{a_k}} $,试讨论级数$\sum\limits_{n = 1}^\infty {\frac{{{a_n}}}{{{s_n...
分类:其他好文   时间:2014-05-04 19:03:33    阅读次数:360
HDU 3036 拆点二分最大流
Escape Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 584    Accepted Submission(s): 117 Problem Description R's girl friend D is on m...
分类:其他好文   时间:2014-05-04 18:38:40    阅读次数:379
HDU-1015-Safecracker
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1015 深搜简单题 代码如下: #include #include #include #include using namespace std; string a; int t; int v,w,x,y,z; int vis[20]; int b[6]; int flag; int cmp(int...
分类:其他好文   时间:2014-05-04 18:09:00    阅读次数:352
HDU 3033 分组背包
题意: 给定n个物品 m元,k种商品 下面n行 tpye w v 表示物品的牌子,价格,价值(每个物品只有1件) 问:每个牌子至少买一件能获得的最大价值是多少 思路:分组背包 #include #include #include #include #include using namespace std; #define ll int ll n, m, k; l...
分类:其他好文   时间:2014-05-04 18:03:15    阅读次数:248
求数组中和为给定值的任意两个数
题目: 输入一个已经按升序排序过的数组和一个数字,在数组中查找两个数,使得它们的和正好是输入的那个数字。要求时间复杂度是O(n)。如果有多对数字的和等于输入的数字,输出任意一对即可。 例如输入数组1、2、4、7、11、15和数字15。由于4+11=15,因此输出4和11。 思路: 最直接的做法是暴力法,两个for循环,时间复杂度为O(n*n),但是这样没有充分利用升序数组这一前提。我们假设数组为A,长度为len,给定的和为sum,最好的方法是先用数组的第一个数A[lo...
分类:其他好文   时间:2014-05-04 17:56:57    阅读次数:596
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!