码迷,mamicode.com
首页 >  
搜索关键字:hdu 4719 oh my holy    ( 45498个结果
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
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
求字符串2是是否是字符串1的字串
templateT my_search(T first1, T last1, T first2, T last2){ int d1 = distance(first1, last1); int d2 = distance(first2, last2); if(d1 < d2) ...
分类:其他好文   时间:2014-05-04 19:54:06    阅读次数:226
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
HDU 2680Choose the best route (SPFA)
转载请注明出处:http://blog.csdn.net/u012860063 百度之星编程大赛——您报名了吗?  杭电ACM 2014暑期集训队——选拔安排~ Choose the best route Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/327...
分类:其他好文   时间:2014-05-04 09:43:23    阅读次数:360
hdu-3401-Trade-单调队列优化的DP
单调队列入门题。。。 dp[i][j]:第i天,手中拥有j个股票时,获得的最大利润。 若第i天不买不卖:dp[i][j]=max(dp[i][j],dp[i-1][j]); 若第i天买            :dp[i][j]=max(dp[i][j],dp[i-w-1][k]-(j-k)*ap[i]); 若第i天卖            :dp[i][j]=max(dp[i][j],dp...
分类:其他好文   时间:2014-05-04 09:13:22    阅读次数:303
HDU 3033 I love sneakers! (01背包+反分组背包)
HDU 3033 I love sneakers! (01背包+反分组背包)...
分类:其他好文   时间:2014-05-04 08:51:09    阅读次数:229
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!