Nasty Hacks

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 2299    Accepted Submission(s): 1816

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

解题思路:继续水题。直接比較每行的三个数。假设第一个数大于第二个数减去第三个数,则须要做广告。若等于。就无所谓。否则。不做广告。

AC代码:

#include <iostream>
#include <cstdio>
using namespace std; int main(){
// freopen("in.txt", "r", stdin);
int n, a, b, c;
while(scanf("%d", &n)==1){
for(int i=0; i<n; i++){
scanf("%d%d%d", &a, &b, &c);
if(a < b - c) printf("advertise\n");
else if(a == b - c) printf("does not matter\n");
else printf("do not advertise\n");
}
}
return 0;
}

HDU 2317 Nasty Hacks的更多相关文章

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

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

  2. HDOJ 2317. Nasty Hacks 模拟水题

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

  3. Poj 3030 Nasty Hacks

    1.Link: http://poj.org/problem?id=3030 2.Content: Nasty Hacks Time Limit: 1000MS   Memory Limit: 655 ...

  4. Nasty Hacks <入门练手题>

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

  5. dir命令只显示文件名

    dir /b 就是ls -f的效果 1057 -- FILE MAPPING_web_archive.7z 2007 多校模拟 - Google Search_web_archive.7z 2083 ...

  6. hdu2317Nasty Hacks

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

  7. HOJ题目分类

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  8. POJ解题经验交流

    感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理.   题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...

  9. OJ题解记录计划

    容错声明: ①题目选自https://acm.ecnu.edu.cn/,不再检查题目删改情况 ②所有代码仅代表个人AC提交,不保证解法无误 E0001  A+B Problem First AC: 2 ...

随机推荐

  1. 关于set和multiset的一些用法

    set的一些用法 set的特性 set的特性是,所有元素都会根据元素的键值自动排序,set不允许两个元素有相同的键值. set的一些常用操作函数 insert() insert(key_value); ...

  2. DRF filter

    filter 配置 fiter定义 自定义filter继承BaseFilterBackend,必须重写filter_queryset,返回值为过滤后的queryset filter在GenericAP ...

  3. 使用adb命令启查看已安装的Android应用的versionCode、versionName

    列出已经安装的应用 adb shell pm list package C:\Users\CJTDEV003>adb shell pm list package package:com.sams ...

  4. CoCoS 2D-JS的开发环境搭建

    CoCoS 2D-JS的开发环境搭建 在Hbuilder中新建web项目,将cocos2d-js-v3.9.js复制到在js文件夹下,将project.json复制到工程的根目录下 在index.ht ...

  5. Leetcode 322.零钱兑换

    零钱兑换 给定不同面额的硬币 coins 和一个总金额 amount.编写一个函数来计算可以凑成总金额所需的最少的硬币个数.如果没有任何一种硬币组合能组成总金额,返回 -1. 示例 1: 输入: co ...

  6. 雅礼培训 Problem A 【线段树】

    题意 维护一段区间,支持求区间最大值,区间且,区间或 \(n,q<=2*10^5\) 题解 我们用线段树维护区间最大值 对于and和or运算, and实质就是强行把一些位改为0 or实质就是强行 ...

  7. bzoj2324 [ZJOI2011]营救皮卡丘 费用流

    [ZJOI2011]营救皮卡丘 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 2653  Solved: 1101[Submit][Status][D ...

  8. Linux(15):shell 编程

    shell基础 什么是 shell ? Shell是一个命令解释器,它的作用是解释执行用户输入的命令及程序等,用户输入一条命令, Shell 就解释执行一条. 这种从键盘一输入命令,就可以立即得到回应 ...

  9. [NOIP2011] 洛谷P1313 计算系数

    题目描述 给定一个多项式(by+ax)^k,请求出多项式展开后x^n*y^m 项的系数. 输入输出格式 输入格式: 输入文件名为factor.in. 共一行,包含5 个整数,分别为 a ,b ,k , ...

  10. 如何使用ftrace

    基本使用 1. 编译内核 ref:http://www.omappedia.org/wiki/Installing_and_Using_Ftrace========================== ...