摘要: POJ 2112 Optimal Milking (二分+最短路径+网络流)Optimal MilkingTime Limit:2000MSMemory Limit:30000KTotal Submissions:10176Accepted:3698Case Time Limit:1000MSDes... 阅读全文
posted @ 2013-08-26 22:05 炒饭君 阅读(161) 评论(0) 推荐(0) 编辑
摘要: POJ 2135 Farm Tour (最小费用最大流)两遍spfa解决#include #include #include #include #include using namespace std;const int maxn=30000;const int inf=2000000000;str... 阅读全文
posted @ 2013-08-26 13:54 炒饭君 阅读(125) 评论(0) 推荐(0) 编辑
摘要: uva 11553 Grid Game (回溯- 类似,比八皇后问题简单)Problem GGRID GAMEAlice and Bob both have lots of candies but want more. They decide to play the following turn-... 阅读全文
posted @ 2013-08-26 10:19 炒饭君 阅读(404) 评论(0) 推荐(0) 编辑
摘要: uva 10718 Bit Mask (位运算)Problem ABit MaskTime Limit1 SecondIn bit-wise expression, mask is a common term. You can get a certain bit-pattern using mask... 阅读全文
posted @ 2013-08-25 15:00 炒饭君 阅读(192) 评论(0) 推荐(0) 编辑
摘要: POJ 1506 Largest Rectangle in a Histogram (dp的思想)#include #include #include #include using namespace std;const int maxn=100010;unsigned long long a[ma... 阅读全文
posted @ 2013-08-24 14:13 炒饭君 阅读(135) 评论(0) 推荐(0) 编辑
摘要: HDU 2282 Chocolate (最小费用最大流)#include #include #include #include using namespace std;const int maxn=30000;const int inf=200000000;struct edge{ int u,v,... 阅读全文
posted @ 2013-08-22 17:02 炒饭君 阅读(135) 评论(0) 推荐(0) 编辑
摘要: POJ 2426 Interesting Housing Problem (最大费用最大流)#include #include #include #include using namespace std;const int maxn=30000;const int inf=200000000;str... 阅读全文
posted @ 2013-08-22 14:22 炒饭君 阅读(183) 评论(0) 推荐(0) 编辑
摘要: POJ 3422 Kaka's Matrix Travels (最大费用最大流)#include #include #include #include using namespace std;const int maxn=20000;const int inf=20000000;struct edg... 阅读全文
posted @ 2013-08-22 12:56 炒饭君 阅读(168) 评论(0) 推荐(0) 编辑
摘要: POJ 1011 Sticks backtrakcing+剪枝#include #include #include #include #include using namespace std;int n,sum,maxx,marked,visited[100],ans;vector v;void... 阅读全文
posted @ 2013-08-21 15:33 炒饭君 阅读(125) 评论(0) 推荐(0) 编辑
摘要: uva 11386 Triples这题 应该用 hash , 用 STL map超时,但是我自己手写二分,再加一些优化,限时8秒,我7.8秒卡过,很爽!这题弹了很多遍,注意的是,ans 用int 不够,最后直接改为long long 就过了,因为这题数据没说范围,只说了是正整数,所以有点不爽啊。。。... 阅读全文
posted @ 2013-08-21 12:32 炒饭君 阅读(161) 评论(0) 推荐(0) 编辑