博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
poj 3030 Nasty Hacks
阅读量:4973 次
发布时间:2019-06-12

本文共 1636 字,大约阅读时间需要 5 分钟。

Nasty Hacks
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 9031   Accepted: 6352

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: −106r, 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

30 100 70100 130 30-100 -70 40

Sample Output

advertisedoes not matterdo not advertise
#include
using namespace std; int main() {
int n; int r,e,c; cin>>n; while(n--) {
cin>>r>>e>>c; if(r<(e-c)) cout<<"advertise"<
(e-c)) cout<<"do not advertise"<
 

转载于:https://www.cnblogs.com/w0w0/archive/2011/11/22/2258747.html

你可能感兴趣的文章
hdu1502 , Regular Words, dp,高精度加法
查看>>
20120227_CET6
查看>>
SpringBoot在idea中的热部署配置
查看>>
MyEclipse连接SQL Server 2008数据库的操作方法
查看>>
leetcode【67】-Bulb Switcher
查看>>
JS验证图片格式和大小并预览
查看>>
laravel5.2 移植到新服务器上除了“/”路由 ,其它路由对应的页面显示报404错误(Object not found!)———新装的LAMP没有加载Rewrite模块...
查看>>
编写高质量代码--改善python程序的建议(六)
查看>>
windows xp 中的administrator帐户不在用户登录内怎么解决?
查看>>
接口和抽象类有什么区别
查看>>
Codeforces Round #206 (Div. 2)
查看>>
**p
查看>>
优先队列详解
查看>>
VS2012 创建项目失败,,提示为找到约束。。。。
查看>>
设计类图
查看>>
类对象
查看>>
[Voice communications] 声音的滤波
查看>>
SQL语言之概述(一)
查看>>
Learning Cocos2d-x for XNA(2)——深入剖析Hello World
查看>>
软件建模——第9章 毕业论文管理系统—面向对象方法
查看>>