Poj 3030 Nasty Hacks
1.Link:
http://poj.org/problem?id=3030
2.Content:
Nasty Hacks
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12350 Accepted: 8537 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 40Sample Output
advertise
does not matter
do not advertiseSource
3.Method:
4.Code:
#include<iostream>
using namespace std;
int main()
{
int i,n;
int r,e,c;
int result;
cin>>n;
for(i=;i<n;i++)
{
cin>>r>>e>>c;
result=e-c-r;
if(result>) cout<<"advertise"<<endl;
else if(result<) cout<<"do not advertise"<<endl;
else cout<<"does not matter"<<endl;
}
//system("pause");
return ; }
5.Reference:
Poj 3030 Nasty Hacks的更多相关文章
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- HDOJ(HDU) 2317 Nasty Hacks(比较、)
Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...
- Nasty Hacks <入门练手题>
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total S ...
- HDU 2317 Nasty Hacks
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- POJ解题经验交流
感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理. 题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...
- 算法之路 level 01 problem set
2992.357000 1000 A+B Problem1214.840000 1002 487-32791070.603000 1004 Financial Management880.192000 ...
- hdu2317Nasty Hacks
Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...
- dir命令只显示文件名
dir /b 就是ls -f的效果 1057 -- FILE MAPPING_web_archive.7z 2007 多校模拟 - Google Search_web_archive.7z 2083 ...
随机推荐
- 【转】Linux下(C/C++)使用system()函数一定要谨慎
转自:http://my.oschina.net/renhc/blog/53580 曾经的曾经,被system()函数折磨过,之所以这样,是因为对system()函数了解不够深入.只是简单的知道用 ...
- C++技术问题总结-第12篇 设计模式原则
设计模式六大原则,參见http://www.uml.org.cn/sjms/201211023.asp. 1. 单一职责原则 定义:不要存在多于一个导致类变更的原因.通俗的说,即一个类仅仅负责一项职责 ...
- 跳表SkipList
原文:http://www.cnblogs.com/xuqiang/archive/2011/05/22/2053516.html 跳表SkipList 1.聊一聊跳表作者的其人其事 2. 言归正 ...
- Android & Eclipse FAQ
一.eclipse中格式化代码快捷键Ctrl+Shift+F失效的解决办法 当我要格式化代码的时候,右键-source-format能够起效,但ctrl+shift+f不好使了. google之后来发 ...
- aptana中删除空行
问题:有一个css文件,写一行样式后,会换行,空一行,再写另一个样式.现在需要把空的一行给去掉. 尝试直接复制空行,但是aptana会把所有的换行都去了,变成了一个文件只有一行.尝试用正则,\r\t\ ...
- Windows Service 之 详解(一)
一.Windows 服务简介 Windows 服务是可以在系统启动时自动打开的(不需要任何人登录计算机)的程序. 1.适合创建Windows 服务的场景: [1] 在没有用户交互操作的情况下运行程序: ...
- 解决ajax回调函数无返回值得问题
这里以编辑验证角色名为例: 首先,定义一个flag全局变量. 然后,在回调函数resp()中根据判断将flag的值设为true或false. 最后,在调用函数ckrname()中,return fla ...
- 并发MD5计算方法
MD5与SHA算法一样,利用他们可以计算某段数据的唯一hash值,常用做校验码.而MD5比SHA算法性能高.在我参加的一个项目中,主要用MD5码值来去重,因此对计算性能要求较高.网上有对MD5算法并行 ...
- 如果将WCF服务发布为rest模式
WCF是支持多种协议的,其中basicHttpBinding是基础协议绑定,类似于传统的webservice. 如果要将WCF发布成rest,绑定协议要使用webHttpBinding,并且在终结点的 ...
- Linux 命令 - ss: 查看套接字统计信息
命令格式 ss [options] [ FILTER ] 命令参数 -h, --help 显示帮助信息. -V, --version 显示版本信息. -n, --numeric 不解析服务名称. -r ...