poj/hdu
文章平均质量分 80
Twenty_seven
这个作者很懒,什么都没留下…
展开
-
poj2082 stack
如题:http://poj.org/problem?id=2082 题目描述的原创 2014-11-09 10:06:22 · 457 阅读 · 0 评论 -
poj2752 KMP
如题:http://poj.org/problem?id=2752 要求输入一个字符串,求出字符串中原创 2014-11-10 15:34:23 · 403 阅读 · 0 评论 -
poj1423 打表
如题:http://poj.org/problem?id=1423 while(N--){1.输入n原创 2014-10-26 11:18:32 · 492 阅读 · 0 评论 -
poj1723
如题:http://poj.org/problem?id=1723原创 2014-10-27 22:36:09 · 704 阅读 · 0 评论 -
poj 1703 并查集
如题:http://poj.org/problem?id=1703原创 2014-11-16 19:17:17 · 458 阅读 · 0 评论 -
poj2503 哈希表
如题: http://poj.org/problem?id=2503 输入:原创 2014-11-18 20:40:47 · 537 阅读 · 0 评论 -
poj 1742 多重背包(单调队列)
如题:http://poj.org/problem?id=1742 ,...又是这道题 ,第一种方法是二进制拆分多重背包,第二种是原创 2015-01-27 22:34:50 · 616 阅读 · 0 评论 -
poj1742 多重背包单调队列
如题:http://poj.org/problem?id=1742DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coin原创 2015-01-28 02:02:13 · 511 阅读 · 0 评论 -
poj 1787 记录路径的多重背包
如题:http://poj.org/problem?id=1787 DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charli原创 2015-01-29 19:26:03 · 522 阅读 · 0 评论 -
poj3260 混合背包
如题:http://poj.org/problem?id=3260 DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the small原创 2015-01-31 18:02:57 · 474 阅读 · 0 评论 -
poj1276 多重背包
如题:http://poj.org/problem?id=1276 DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine us原创 2015-01-31 10:33:32 · 416 阅读 · 0 评论 -
poj2392 多重背包
如题:http://poj.org/problem?id=2392给出几种石头的每个的高度,使用当前石头不允许超过的最大高度,石头的数量,要求求所有石头最大能组成的高度。 首先由最大高度最小的那组拿石头,最后从最大高度最大的那组拿,保证了背包容量的不断增加,使得dp关系成立。 dp策略:当前最大高度是否可以达到,,这里使用了辅助数组used,used[i]代表了当前高度i之前使原创 2015-01-31 10:19:42 · 481 阅读 · 0 评论 -
poj3281 DINIC
如题:http://poj.org/problem?id=3281 初学最大流. 这题重要的是图的构建。源点-》食物-》牛-》牛-》饮料-》汇点。0是源点,1-f食物,f+1-f+1+n食物到牛,f+1+n-f+1+2*n牛到牛,f+1+2*n-f+1+2*n+d牛到饮料,f+1+2*n+d+1最终汇点。 按照上面建图,用DINIC算法求最大流即可.原创 2014-12-13 13:11:50 · 410 阅读 · 0 评论 -
poj1273 EK
如题:http://poj.org/problem?id=1273 EK算法求最大流,注意重边的处理。#includeusing namespace std;#include#define inf 0x7fffffffint map[202][202];queuemyque;int pre[202];int N,M;int MIN(int x,in原创 2014-12-13 00:10:24 · 433 阅读 · 0 评论 -
POJ 3624 01背包
如题http://poj.org/problem?id=3624 最基础的01背包 #include#include#includeusing namespace std;#define MAXN 3500#define MAXV 13000#define max(a,b)(a>b?a:b)int N,M;int c[MAXN];int w[MAXN原创 2015-01-17 13:43:36 · 391 阅读 · 0 评论 -
poj1321 DFS
如题:http://poj.org/problem?id=1321 注意这句话“其中 # 表示棋盘区域”,一开始我以为棋子只能放在“.”的位置,没想到只能放在"#"的位置才对....无语。。。。汉字题目都没看懂 vis[i][j]=2代表这一列有其它棋子,不能放,vis[i][j]=1代表是“.”,所以不能放..其实只要不能放就设为已经访问过(1)原创 2015-01-05 14:23:21 · 422 阅读 · 0 评论 -
poj1976 dp
如题:http://poj.org/problem?id=1976 DescriptionA train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Ther原创 2015-01-23 21:17:42 · 437 阅读 · 0 评论 -
POJ2063 完全背包
如题:http://poj.org/problem?id=2063 题目给出初始金额和年利率,要求求出在X年内的最大收益 本金都是1000的倍数所以1000000/1000=1000,(The value of a bond is always a multiple of $1 000.)加上每年的收益绝对是小于本金的,(The interest of a bond i原创 2015-01-23 11:11:52 · 459 阅读 · 0 评论 -
poj1260 dp
如题:http://poj.org/problem?id=1260 PearlsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7698 Accepted: 3806DescriptionIn Pearlania everybody is fond o原创 2015-03-19 14:22:38 · 303 阅读 · 0 评论 -
poj2104 线段树+二分搜索
如题:http://poj.org/problem?id=2104 K-th NumberTime Limit: 20000MS Memory Limit: 65536KTotal Submissions: 39943 Accepted: 13042Case Time Limit: 2000MSDescript原创 2015-03-15 15:24:22 · 452 阅读 · 0 评论 -
poj2377 最小生成树
如题:http://poj.org/problem?id=2377Bad CowtractorsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11056 Accepted: 4661DescriptionBessie has been hired to原创 2015-03-04 10:52:01 · 356 阅读 · 0 评论 -
poj1258
如题:http://poj.org/problem?id=1258Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 42375 Accepted: 17317DescriptionFarmer John has been elected ma原创 2015-03-03 22:22:11 · 373 阅读 · 0 评论 -
poj3268 dijsktra
如题:http://poj.org/problem?id=3268Silver Cow PartyTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 13502 Accepted: 6082DescriptionOne cow from each of N原创 2015-03-03 15:16:22 · 432 阅读 · 0 评论 -
poj2139
如题:http://poj.org/problem?id=2139Six Degrees of Cowvin BaconTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3264 Accepted: 1519DescriptionThe cows have原创 2015-03-03 11:55:22 · 416 阅读 · 0 评论 -
poj3259 负权环判定
如题:http://poj.org/problem?id=3259WormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 33015 Accepted: 12016DescriptionWhile exploring his many far原创 2015-03-03 11:49:06 · 384 阅读 · 0 评论 -
poj3614 贪心
如题:http://poj.org/problem?id=3614SunscreenTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4426 Accepted: 1544DescriptionTo avoid unsightly burns whi原创 2015-03-01 17:51:51 · 419 阅读 · 0 评论 -
poj3280 dp
如题:http://poj.org/problem?id=3280Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6232 Accepted: 3036DescriptionKeeping track of all原创 2015-02-27 17:10:49 · 420 阅读 · 0 评论 -
poj3616 dp
如题:http://poj.org/problem?id=3616Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5228 Accepted: 2162DescriptionBessie is such a hard-wor原创 2015-02-27 13:37:18 · 318 阅读 · 0 评论 -
poj2229 dp
如题:http://poj.org/problem?id=2229SumsetsTime Limit: 2000MS Memory Limit: 200000KTotal Submissions: 13748 Accepted: 5464DescriptionFarmer John commanded his cows t原创 2015-02-26 11:29:02 · 360 阅读 · 0 评论 -
poj1862 贪心
如题:http://poj.org/problem?id=1862我都觉得水的题,真的是够水了。题目大意:给出几个数,每次随意取出2个a,b,变成一个2*sqrt(a*b)在放回去,要求最终的最小值。 思路:维护一个大根堆,取出之后合成在放回去,剩一个的时候就是答案。#include#include#include#includeusing namespace原创 2015-02-25 14:33:05 · 389 阅读 · 0 评论 -
poj1328 贪心
如题:http://poj.org/problem?id=1328 Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 56739 Accepted: 12802DescriptionAssume the coastin原创 2015-02-22 11:57:30 · 442 阅读 · 0 评论 -
poj2376 贪心
如题:http://poj.org/problem?id=2376 Cleaning ShiftsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12069 Accepted: 3140DescriptionFarmer John is assigni原创 2015-02-21 21:38:01 · 578 阅读 · 0 评论 -
poj3187 穷竭搜索
如题:http://lol.duowan.com/1501/286125181396.html Backward Digit SumsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4705 Accepted: 2703DescriptionFJ an原创 2015-02-21 19:57:21 · 371 阅读 · 0 评论 -
poj2718 穷举
POJ 2718 Smallest Difference将一个数切一刀拆成两个数,两个数每一位数字的顺序都可改变,但是不能有前导0。求这两个数之差的最小值。我使用了搜索并且避免了递归,自认为是比较好的算法。一开始我想到的是枚举,并且很快给出了实现:12345678910111213141516转载 2015-02-21 14:29:23 · 476 阅读 · 0 评论 -
poj3169 差分约束系统
如题:http://poj.org/problem?id=3169 LayoutTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7711 Accepted: 3708DescriptionLike everyone else, cows like to原创 2015-02-20 10:24:08 · 430 阅读 · 0 评论 -
poj3255 dijsktra求次短路经
如题:http://poj.org/problem?id=3255RoadblocksTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 8192 Accepted: 2984DescriptionBessie has moved to a small f原创 2015-02-19 12:42:30 · 396 阅读 · 0 评论 -
poj1182 食物链
如题:http://poj.org/problem?id=1182 食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 48224 Accepted: 14060Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形原创 2015-02-17 00:14:54 · 395 阅读 · 0 评论 -
hdu1829 并查集
如题:http://acm.hdu.edu.cn/showproblem.php?pid=1829 A Bug's Life Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9845 Accepted Submiss原创 2015-02-17 00:08:01 · 367 阅读 · 0 评论 -
poj2431 优先队列
如题:http://poj.org/problem?id=2431 ExpeditionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7851 Accepted: 2296DescriptionA group of cows grabbed a tr原创 2015-02-16 00:04:22 · 467 阅读 · 0 评论 -
poj3253 堆/优先队列
如题:http://poj.org/problem?id=3253Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 28608 Accepted: 9295DescriptionFarmer John wants to repai原创 2015-02-14 20:59:37 · 405 阅读 · 0 评论