UVa 10141 - Request for Proposal
来源:互联网 发布:苹果删不掉windows系统 编辑:程序博客网 时间:2024/06/07 05:48
题目:政府要做n个项目,对p个公司招标,政府想知道哪家公司能做的项目最多并且花费更少。
分析:简单题。因为每个厂家提供的方案都在招标的列表中,直接计数比较即可。
说明:注意数据格式,有几天没刷题了,要赶快不少( ⊙ o ⊙ )啊!。
#include <algorithm>#include <iostream>#include <cstdlib>#include <cstring>#include <string>#include <cstdio>#include <cmath>using namespace std;string P[1001], temp, name, ans;int main(){int n, p, T = 0;while (~scanf("%d%d", &n, &p) && n) {getchar();for (int i = 0 ; i < n ; ++ i)getline(cin, P[i]);int maxm = 0, count, number;doublecost = 0.0,price;for (int i = 0 ; i < p ; ++ i) {getline(cin, name);scanf("%lf%d", &price, &number);getchar();count = 0;for (int j = 0 ; j < number ; ++ j) {getline(cin, temp);count ++;}if (maxm == count && cost > price) {cost = price;ans = name; }if (maxm < count) {maxm = count;cost = price;ans = name;}}if (T ++) printf("\n");cout << "RFP #" << T << endl;cout << ans << endl;} return 0;}
0 0
- UVa 10141 - Request for Proposal
- Research Proposal for PhD Studies
- Proposal
- RFC(Request For Comments)
- RFQ(request for quotation)
- Research Proposal
- Proposal Writing
- 提案 proposal
- proposal presentation
- Proposal Research
- AI 《A PROPOSAL FOR THE DARTMOUTH SUMMER RESEARCH PROJECT ON ARTIFICIAL INTELLIGENCE》读后总结
- 【aixiv2016】DeepText A Unified Framework for Text Proposal Generation and Text Detection in Natural I
- The Proposal of Service Oriented Data Mining System for Solving Real-Life Classification--阅读笔记
- Prompt for customizing request/prompt for local workbench request
- 关于RFC(Request For Comments)
- 关于RFC(Request For Comments)
- Acknowledgements and Request for Remarks
- [RFC] Request For Comments List
- Android系统移植方法详解1
- 打造linux下的source insight——vim插件安装使用总结
- solr4.x之原子更新
- php 函数
- 使用YSlow,对自己的网站进行评分
- UVa 10141 - Request for Proposal
- Centos服务器配置
- Android系统移植之按键移植
- 2014年12月11日下午——周四
- win7 CMD登录本机MySQL数据库管理
- 20141212
- 从C开始_概述_仔细瞧瞧
- Java8的lambda(1)
- IOS 获取当前设备安装的所有App