poj 3686 The Windy's】的更多相关文章

The Windy's Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 5362   Accepted: 2249 Description The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The ma…
http://poj.org/problem?id=3686 #include <cstdio> #include <cstring> #include <algorithm> #define maxn 30000 using namespace std; <<; ][maxn],lx[maxn],ly[maxn],match[maxn],a[][]; bool sx[maxn],sy[maxn]; int n,m; bool path(int u) { s…
The Windy's Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4158   Accepted: 1777 Description The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receivesN orders for toys. The man…
[题目链接] http://poj.org/problem?id=3686 [题目大意] 每个工厂对于每种玩具的加工时间都是不同的, 并且在加工完一种玩具之后才能加工另一种,现在求加工完每种玩具的平均时间 [题解] 因为每个工厂加工一个零件在不同的时间是有不同代价的, 我们发现对于一个工厂在每次加工一个零件时候,时间要加上之前所有的零件的时间的条件 其实等价于对这个工厂加工的零件乘上1~N的不同系数. 那么我们将这个工厂对于时间进行拆点,对于费用乘上不同的系数,求一遍费用流即可 [代码] #in…
每个工厂拆成N个工厂,费用分别为1~N倍原费用. //#pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<iostream> #include<sstream> #include<cmat…
题意:有n个订单m个车间,每个车间均可以单独完成任何一个订单.每个车间完成不同订单的时间是不同的.不会出现两个车间完成同一个订单的情况.给出每个订单在某个车间完成所用的时间.问订单完成的平均时间是多少. 析:这个题可以用最小费用流或者最佳完全匹配来做,因为只有车间和订单,满足二分图,主要是在建图. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include…
题意:n个订单和m个生产车间,每个订单在不同的车间生产所需要的时间不一样,并且每个订单只能在同一个车间中完成,直到这个车间完成这个订单就可以生产下一个订单.现在需要求完成n个订单的平均时间最少是多少.(每个订单的单独时间之和/n,包括等待时间). 主要是建图,考虑第i个订单在第j个车间倒数第k个被生产,那么第i个订单在第j个区间所花费的时间为k*mat[i][j]. 每个区间最多生产n个订单,那么就可以把n*m的图转化成n*(n*m)的图进而用km算法求最小权值. 所以把每个权值取反进而求最大权…
http://poj.org/problem?id=3686 题意:给出n个玩具和m个工厂,每个工厂加工每个玩具有一个时间,问要加工完这n个玩具最少需要等待的平均时间.例如加工1号玩具时间为t1,加工2号玩具时间为t2.那么先加工玩具1再加工玩具2花费的时间是t1+(t1+t2),先加工玩具2在加工玩具1花费的时间是t2+(t1+t2). 思路:假设所有玩具在一个工厂加工,那么等待的时间是 t1 + (t1 + t2) + (t1 + t2 + t3) + …… = t1 * n + t2 *…
题目链接 The Windy's | Time Limit: 5000MS | Memory Limit: 65536K | | Total Submissions: 4939 | Accepted: 2080 | Description The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for…
The Windy's Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3791   Accepted: 1631 Description The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The ma…