poj 3030 Nasty Hacks
来源:互联网 发布:vue.js event.target 编辑:程序博客网 时间:2024/06/05 02:28
Description
You are the CEO of Nasty Hacks Inc., a company that creates small pieces of malicious software which teenagers may use to fool their friends. The company has just finished their first product and it is time to sell it. You want to make as much money as possible and consider advertising in order to increase sales. You get an analyst to predict the expected revenue, both with and without advertising. You now want to make a decision as to whether you should advertise or not, given the expected revenues.
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
Source
Nordic 2006
在浏览别人的博客时,偶然发现了这道水题。难得啊,poj上竟然会有和A + B一样的纯净水!这就是众多试题中的一股清流!简单点,出题的方式简单点。
/*Problem: 3030 User: sarukaMemory: 368K Time: 0MSLanguage: G++ Result: Accepted*/#include<cstdio>int getint(){ int r = 0, k = 1; char c = getchar(); for(; c < '0' || c > '9'; c = getchar()) if(c == '-') k = -1; for(; c >= '0' && c <= '9'; c = getchar()) r = r * 10 + c - '0'; return r * k;}int n, r, e, c;int main(){ n = getint(); while(n) { r = getint(); e = getint(); c = getint(); if(r + c > e) printf("do not advertise\n"); else if(r + c == e) printf("does not matter\n"); else printf("advertise\n"); n--; } return 0;}
Powered By Saruka
Copyright © 2016 All Rights Reserved.
- POJ 3030 Nasty Hacks
- poj 3030 Nasty Hacks
- poj 3030 Nasty Hacks
- Poj 3030 Nasty Hacks
- poj 3030 Nasty Hacks
- POJ 3030 Nasty Hacks
- POJ 3030 - Nasty Hacks
- poj 3030 水题 Nasty Hacks
- POJ 3030 && HDU 2317 Nasty Hacks(水~)
- Nasty Hacks
- Nasty Hacks
- POJ 3030 Nasty Hacks(我的水题之路——比较大小)
- 2317:Nasty Hacks
- HDU 2317 Nasty Hacks
- HOJ 2453 Nasty Hacks
- HDU2317:Nasty Hacks
- hdu-2317-Nasty Hacks
- Nasty Hacks 2317
- Swift学习记录 -- 15.tableView的创建与基本操作
- 猜歌游戏 总结二
- 单链表的整表创建--头插法
- 猜歌游戏 三
- 单链表整表的创建--尾插法
- poj 3030 Nasty Hacks
- 短作业调度算法
- Java:接口
- 猜歌游戏 四
- node+express+mongodb可运行
- 生日快乐啊for MR.x
- HDU 5118 GRE Words Once More!(2014亚洲区北京站现场赛)
- 格雷厄姆数字价值投资--python
- 关于DNS