poj水题--ID3030
2012-10-09 20:38
344 查看
Problem:
Input
The input consists of n cases, and the first line consists of one positive integer giving n. The next n lines each contain 3 integers, r, e and c. The first, r, is the expected revenue if you do not advertise, the second, e, is the expected revenue if you do advertise, and the third, c, is the cost of advertising. You can assume that the input will follow these restrictions: −106 ≤ r, e ≤ 106 and 0 ≤ c ≤ 106.
Output
Output one line for each test case: “advertise”, “do not advertise” or “does not matter”, presenting whether it is most profitable to advertise or not, or whether it does not make any difference.
Sample Input
Sample Output
PS:input中描述的蓝色加粗部分,其实是输入值的限定条件,起初整错了陷入死循环了;其实ACM这个平台对题目的验证,貌似对这样的限定条件并无要求,也就是说不会用非法值去验证你的程序是否通过。这也是做ACM的一个小经验吧,嘿嘿
Input
The input consists of n cases, and the first line consists of one positive integer giving n. The next n lines each contain 3 integers, r, e and c. The first, r, is the expected revenue if you do not advertise, the second, e, is the expected revenue if you do advertise, and the third, c, is the cost of advertising. You can assume that the input will follow these restrictions: −106 ≤ r, e ≤ 106 and 0 ≤ c ≤ 106.
Output
Output one line for each test case: “advertise”, “do not advertise” or “does not matter”, presenting whether it is most profitable to advertise or not, or whether it does not make any difference.
Sample Input
3 0 100 70 100 130 30 -100 -70 40
Sample Output
advertise does not matter do not advertise 我的submission:(又是一次性通过哦,很水的题啦,连我这样的菜鸟都可以通过,O(∩_∩)O哈哈~)
#include <iostream> using namespace std; int main() { int i,r,e,c; cin>>i; while(i>0) { cin>>r>>e>>c; if(e-c>r) cout<<"advertise"<<endl; else if (e-c==r)cout<<"does not matter"<<endl; else cout<<"do not advertise"<<endl; i--; } return 0; }
PS:input中描述的蓝色加粗部分,其实是输入值的限定条件,起初整错了陷入死循环了;其实ACM这个平台对题目的验证,貌似对这样的限定条件并无要求,也就是说不会用非法值去验证你的程序是否通过。这也是做ACM的一个小经验吧,嘿嘿
相关文章推荐
- 一个poj水题--ID 2027
- poj 3030 水题 Nasty Hacks
- poj水题--ID3062
- POJ 3030 Nasty Hacks(我的水题之路——比较大小)
- poj水题--ID3299
- POJ 1002 487-3279(水题)
- POJ 2163 Easy Trading(我的水题之路——数组阶段n m的平均值比较)
- poj 2291/3637 水题排序
- POJ 2328 Guessing Game(我的水题之路——猜数字测谎)
- POJ1046 Color Me Less(水题就当玩吧)
- poj 2262 Goldbach's Conjecture 素数 水题
- POJ 3224 Go for Lab Cup!(我的水题之路——赢的场数最多)
- POJ-1338-暴力水题
- POJ 2665 水题
- 最小生成树-水题-POJ-1789-Truck History
- Poj 1316 Self Numbers(水题)
- poj 字符串相关的水题
- POJ水题1002 487-3279
- Graham 扫描算法求凸包,poj 2187(水题但是是我的第一个求n点集凸包模板)
- poj水题