摘要: 刚刚看到题,感觉是最小割最大流;但是数据量很大,看看网上的题解,发现要把它变成最短路来做;每个孔作为一个点,孔之间的边作为点之间的边;然后利用spfa就可以了!不过这个题runtime error了我15发;经大师提醒才知道,在main函数里面不能够开大数组;因为main函数中的变量保存在栈中;代码:#include#include#include#define inf 1e8using namespace std;const int maxn=2*1005*1005;const int maxm=3*maxn;struct edge{ int from,to,dist; edge... 阅读全文
posted @ 2013-12-01 20:57 Yours1103 阅读(146) 评论(0) 推荐(0) 编辑