POJ3469:Dual Core CPU——题解】的更多相关文章

Dual Core CPU Time Limit: 15000MS   Memory Limit: 131072K Total Submissions: 25576   Accepted: 11033 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft C…
http://poj.org/problem?id=3469 题目大意: 两个CPU,处理每个任务有不同的代价,有些对任务如果不在同一个CPU就会增加代价,求最小代价. ———————————————————————————— 一看,网络流,再一看,最小. 哦,最小割. 咋做啊,不会…… 查题解吧,学一学最小割的建图方法. 哦----这样啊. 割一个图,就是将图中的点分为属于源点(S)和属于汇点(T)两个集合. 那么我们将属于S的点视为用了A CPU的.所以我们建图就把S连到任务点的容量为用A…
刚学了Dinic就开始做题,然后就崩了. 题意:若干个任务,可以放在两个CPU中任意一个上完成,各有一定代价.其中又有若干对任务,如果它们不在同一个CPU上完成,会产生额外代价.最小化并输出代价. 一开始的想法是吧一个任务拆开成两个点(受2-sat的影响),然后就发现自己没法做了.首先,需要保证由同一个任务拆成的两个点只流过一个,这就会使最大流变成费用流.(我不会费用流)其次,难以满足第二个要求.后来一想,网络流与2-sat建图的区别在于网络流的状态表现在边的流量上(是否满流),而2-sat表现…
形象生动的最小割.. #include<cstdio> #include<cstring> #include<queue> #include<algorithm> using namespace std; #define INF (1<<30) #define MAXN 2222 #define MAXM 888888 struct Edge{ int v,cap,flow,next; }edge[MAXM]; int vs,vt,NE,NV;…
题意:给你n个模块,每个模块在A核花费为ai,在B核跑花费为bi,然后由m个任务(ai,bi,wi),表示如果ai,bi不在同一个核上跑,额外的花费为wi,求最小的花费. 一开始想的时候以为是费用流,但想着想着觉得,这么大的数据量绝对不可能是费用流.最后发现它是一个最小割模型.实际上就是要将网络里的模块划分成s-t两个点集,然后我们合适的构造一下边就可以使得对应的最小割就是我们的答案,构造的方法是这样的:当模块属于A集的时候,花费为ai,所以就从向t连一条ai的边,而当模块属于B集的时候,花费为…
题目:http://poj.org/problem?id=3469 最小割水题(竟然没能1A): 代码如下: #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; ,maxm=2e5+,inf=0x3f3f3f3f; ,cur[maxn],ans; queue<int>q; struct N{ int to,nxt,w;…
Dual Core CPU Time Limit: 15000MS   Memory Limit: 131072K Total Submissions: 21453   Accepted: 9297 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft Co…
Dual Core CPU Time Limit: 15000MS Memory Limit: 131072K Total Submissions: 20935 Accepted: 9054 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft Corpor…
Dual Core CPU Time Limit: 15000MS   Memory Limit: 131072K Total Submissions: 24830   Accepted: 10756 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft C…
Time Limit: 15000MS   Memory Limit: 131072K Total Submissions: 23780   Accepted: 10338 Case Time Limit: 5000MS Description As more and more computers are equipped with dual core CPU, SetagLilb, the Chief Technology Officer of TinySoft Corporation, de…