POJ 1018】的更多相关文章

Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, we are free to choose from several manufacturers. Same devices from two manufacturers d…
题意: 给出n个工厂的产品参数带宽b和价格p,在这n个工厂里分别选1件产品共n件,使B/P最小,其中B表示n件产品中最小的b值,P表示n件产品p值的和. 输入 iCase n 表示iCase个样例n个工厂 m1 p1 b1 p2 b2..pm1 bm1 //第一个工厂有m1个同种类不同参数的产品,每一个产品的参数分别是p1 b1 p2 b2 m2 p1 b1 p2 b2..pm2 bm2 ... mn p1 b1 p2 b2..pmn bmn 思路: 排序,先把b从小到大排序,然后把p从小到大排…
http://poj.org/problem?id=1018 题意: 某公司要建立一套通信系统,该通信系统需要n种设备,而每种设备分别可以有m1.m2.m3.....mn个厂家提供生产,而每个厂家生产的同种设备都会存在两个方面的差别:带宽bandwidths 和 价格prices. 现在每种设备都各需要1个,考虑到性价比问题,要求所挑选出来的n件设备,要使得B/P最大. 其中B为这n件设备的带宽的最小值,P为这n件设备的总价. 思路:DP解决. d[i][j]代表选择第i个设备时最小带宽j时的价…
看题传送门:http://poj.org/problem?id=1018 题目大意: 某公司要建立一套通信系统,该通信系统需要n种设备,而每种设备分别可以有m个厂家提供生产,而每个厂家生产的同种设备都会存在两个方面的差别:带宽bandwidths 和 价格prices. 现在每种设备都各需要1个,考虑到性价比问题,要求所挑选出来的n件设备,要使得B/P最大. 其中B为这n件设备的带宽的最小值,P为这n件设备的总价. 思路: 贪心+枚举 要使得B/P最大,则B应该尽量大,而P尽量小. 可以按照价格…
题目链接:http://poj.org/problem?id=1018 题目大意:有n种通讯设备,每种有mi个制造商,bi.pi分别是带宽和价格.在每种设备中选一个制造商让最小带宽B与总价格P的比值B/P最大. 解法是枚举最小带宽B,每种设备在带宽大于B的制造商中找价格最小的,最后取比值最大的. 详见代码: #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using…
点击打开链接 Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21007   Accepted: 7449 Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several d…
题意:给你n个厂,每个厂有m个产品,产品有B(带宽),P(价格),现在要你求最大的 B/P 明显是枚举,当P大于一定值,B/P为零,可以用这个剪枝 #include <iostream> #include<cstring> #include<cstdio> using namespace std; #define N 110 #define INF 0xffffff int devb[N][N],devp[N][N]; int b[N*100],tb; int main…
Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21631   Accepted: 7689 Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices.…
Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 29218   Accepted: 10408 Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices…
Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, we are free to choose from several manufacturers. Same devices from two manufacturers d…