Nasty Hacks

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3049    Accepted Submission(s): 2364
Problem 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
 
 
        这个是简单模拟水题,相同的题目有HDOJ 2317、POJ 3030。
        题目大意是说,让我们决策,要不要打广告。给3个数,r,e,c,其中r代表不打广告的期望收益,e代表打广告的期望收益,c代表打广告的费用。那么把(打广告收益-广告费)和不打广告的收益比较一下就好了。
 
 #include <iostream>
using namespace std;
int main()
{
int n, r, e, c;
cin>>n;
while(n--)
{
cin>>r>>e>>c;
if(r<e-c) cout<<"advertise"<<endl;
else if(r>e-c) cout<<"do not advertise"<<endl;
else cout<<"does not matter"<<endl;
}
return ;
}

HDOJ 2317. Nasty Hacks 模拟水题的更多相关文章

  1. HDOJ 1008. Elevator 简单模拟水题

    Elevator Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  2. POJ 2014:Flow Layout 模拟水题

    Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Descr ...

  3. HDOJ(HDU) 2317 Nasty Hacks(比较、)

    Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...

  4. HDU 2317 Nasty Hacks

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  5. HDOJ/HDU 2560 Buildings(嗯~水题)

    Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, ...

  6. HDOJ(HDU) 1859 最小长方形(水题、、)

    Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...

  7. 模拟水题,查看二维数组是否有一列都为1(POJ2864)

    题目链接:http://poj.org/problem?id=2864 题意:参照题目 哈哈哈,这个题discuss有翻译哦.水到我不想交了. #include <cstdio> #inc ...

  8. UVA 10714 Ants 蚂蚁 贪心+模拟 水题

    题意:蚂蚁在木棍上爬,速度1cm/s,给出木棍长度和每只蚂蚁的位置,问蚂蚁全部下木棍的最长时间和最短时间. 模拟一下,发现其实灰常水的贪心... 不能直接求最大和最小的= =.只要求出每只蚂蚁都走长路 ...

  9. Codeforces 1082B Vova and Trophies 模拟,水题,坑 B

    Codeforces 1082B Vova and Trophies https://vjudge.net/problem/CodeForces-1082B 题目: Vova has won nn t ...

随机推荐

  1. Hibernate(2)——Hibernate的实现原理总结和对其模仿的demo

    俗话说,自己写的代码,6个月后也是别人的代码……复习!复习!复习!涉及的知识点总结如下: 开源框架的学习思路(个人总结) Hibernate的运行原理总结 Hibernate实现原理中的两个主要技术 ...

  2. Oracle基础维护01-常用管理命令总结

    概览: 1.Oracle 内存管理 2.Oracle 数据库启动关闭 3.Oracle 参数文件 4.Oracle 控制文件 5.Oracle redo日志文件 6.Oracle undo表空间管理 ...

  3. 全球PM25实时可视化

    星期一的早上,我在办公区鸟瞰窗外,目光所到之处,用顾城的那首"你看天时很近,看我时很远"倒是格外的应景.作为一名父亲,看着工位上3M的口罩,想想此刻还在熟睡的孩子,多少有些无奈-- ...

  4. 自动绘图AI:程序如何画出动漫美少女

    序 全新的图形引擎与AI算法,高效流畅地绘出任何一副美丽的图像. IDE:VisualStudio 2015 Language:VB.NET/C# Graphics:EDGameEngine 第一节 ...

  5. WCF学习系列汇总

    最近在学习WCF,打算把一整个系列的文章都”写“出来,包括理论和实践,这里的“写”是翻译,是国外的大牛写好的,我只是搬运工外加翻译.翻译的不好,大家请指正,谢谢了.如果觉得不错的话,也可以给我点赞,这 ...

  6. C#中级-开机自动启动程序

    一.前言 关于C#开机自动启动程序的方法,网上出现比较多的是修改注册表: 1. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion ...

  7. VS2015突然报错————Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value 'Microsoft.AspNet.Mvc.Razor.TagHelpers.UrlResolutionTagHelper

    Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with ...

  8. 使用Adminlite + ASP.NET MVC5(C#) + Entityframework + AutoFac + AutoMapper写了个api接口文档管理系统

    一.演示: 接口查看:http://apidoc.docode.top/ 接口后台:http://apiadmin.docode.top/ 登录:administrator,123456 二.使用到的 ...

  9. 超越 JSON: Spearal 序列化协议简介

      Spearal 是一个新的开源的序列化协议,这个协议旨在初步替换JSON 将HTML和移动应用连接到Java的后端. Spearal的主要目的是提供一个序列协议,这个协议即使是在端点间传输的复杂的 ...

  10. Backbone中的model和collection在做save或者create操作时, 如何选择用POST还是PUT方法 ?

    Model和Collection和后台的WEB server进行数据同步非常方便, 都只需要在实行里面添加一url就可以了,backbone会在model进行save或者collection进行cre ...