ZOJ 3792 Romantic Value(ISAP && 最小割)...
分类:
其他好文 时间:
2014-08-19 10:55:34
阅读次数:
240
#include #include #include #include using namespace std;const int maxn = 100 + 1;bool g[maxn][maxn];int main( ){ int ncase; scanf("%d", &ncase);...
分类:
其他好文 时间:
2014-08-19 00:59:33
阅读次数:
184
#include#include#include#include#include#include#include#define mem(a,b) memset(a,b,sizeof(a))#define ll __int64#define MAXN 1000#define INF 0x7ffffff...
分类:
编程语言 时间:
2014-08-19 00:55:13
阅读次数:
274
套了个模板直接上,貌似没有随机化序列 QAQ//#pragma comment(linker, "/STACK:16777216") //for c++ Compiler#include #include #include #include #include #include #include #i...
分类:
其他好文 时间:
2014-08-18 21:42:12
阅读次数:
210
Swordfish
Time Limit: 2 Seconds Memory Limit: 65536 KB
There exists a world within our world
A world beneath what we call cyberspace.
A world protected by firewalls,
passwords and the mo...
分类:
其他好文 时间:
2014-08-18 20:32:12
阅读次数:
334
Density of Power NetworkTime Limit:2 Seconds Memory Limit:65536 KBThe vast power system is the most complicated man-made system and the greatest engin...
分类:
Web程序 时间:
2014-08-18 20:07:22
阅读次数:
254
题目地址:ZOJ 3792
最小割做的太少。。这题很明显是找割边。找割边就是判断正向弧是否是0.如果跑完一次最小割后正向弧流量为0的话,那就说明这个边为一条割边。但是找到了割边后再怎么办呢。。中午睡觉的时候突然来了灵感。。再利用这些割边求一次最大流不就行了。。把割边的流量都设为1,其他的都为正无穷。那最后的流量就是最少需要的割边了。然后计算就可以了。
代码如下:
#include
#inc...
分类:
其他好文 时间:
2014-08-18 16:28:22
阅读次数:
264
Idiomatic Phrases Game
Time Limit: 2 Seconds Memory Limit: 65536 KB
Tom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain ...
分类:
其他好文 时间:
2014-08-18 16:22:52
阅读次数:
228
题目大意:
一条直线的街道上, 在x位置有一家餐厅。
现在街上有 N 个客户同时点餐,每个客户都有一个不开心的值的增加速度。
每一分钟未到,就会增加v。
现在要使所有客户的不开心值最小。
思路分析:
开始想的应该是贪心的。先送完一边再去送完另外一边。
但是如果每边都有一个点离餐厅的距离非常大。但是其他的距离都很小。那么此时的最优就是先送完两边小的。
所以
dp[i] [j...
分类:
其他好文 时间:
2014-08-18 14:36:22
阅读次数:
239
MultipleTime Limit:1000MSMemory Limit:32768KTotal Submissions:6177Accepted:1346Descriptiona program that, given a natural number N between 0 and 4999 ...
分类:
其他好文 时间:
2014-08-18 12:12:47
阅读次数:
249