HDU 2317 Nasty Hacks
Nasty Hacks
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2299 Accepted Submission(s): 1816
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.
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.
3
0 100 70
100 130 30
-100 -70 40
advertise
does not matter
do not advertise
解题思路:继续水题。直接比較每行的三个数。假设第一个数大于第二个数减去第三个数,则须要做广告。若等于。就无所谓。否则。不做广告。
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的更多相关文章
- HDOJ(HDU) 2317 Nasty Hacks(比较、)
Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- Poj 3030 Nasty Hacks
1.Link: http://poj.org/problem?id=3030 2.Content: Nasty Hacks Time Limit: 1000MS Memory Limit: 655 ...
- Nasty Hacks <入门练手题>
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total S ...
- dir命令只显示文件名
dir /b 就是ls -f的效果 1057 -- FILE MAPPING_web_archive.7z 2007 多校模拟 - Google Search_web_archive.7z 2083 ...
- hdu2317Nasty Hacks
Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- POJ解题经验交流
感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理. 题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...
- OJ题解记录计划
容错声明: ①题目选自https://acm.ecnu.edu.cn/,不再检查题目删改情况 ②所有代码仅代表个人AC提交,不保证解法无误 E0001 A+B Problem First AC: 2 ...
随机推荐
- 用java Graphics生成验证码
以下下是API文档对Graphics的介绍! Graphics 类是所有图形上下文的抽象基类,允许应用程序在组件(已经在各种设备上实现)以及闭屏图像上进行绘制. Graphics 对象封装了 Java ...
- PAT Basic 1040
1040 有几个PAT 字符串APPAPT中包含了两个单词“PAT”,其中第一个PAT是第2位(P),第4位(A),第6位(T):第二个PAT是第3位(P),第4位(A),第6位(T). 现给定字符串 ...
- Android开发——IntentFilter的匹配规则
1. IntentFilter中的过滤信息 启动Activity分为显式调用和隐式调用,前者没什么好讲的,后者需要Intent能够匹配目标组件的IntentFilter中所设置的过滤信息.包括act ...
- 自学入门 Python 优质中文资源索引
所有资源基于 Python3 版本,全部中文内容,适用于 爬虫 / Web / 数据 方向,每个单元根据学习习惯从 书籍 / 文档 / 视频 中选择一类即可,建议任选一本书籍,然后配合文档类进行学习. ...
- Pyhton开发:Python基础杂货铺
if 语句 Python条件语句是通过一条或多条语句的执行结果(True或者False)来决定执行的代码块. Python中if语句的一般形式如下所示: if condition_1: stateme ...
- VBS脚本获取安全标识符SID(Security Identifiers)的方法
一.SID简介 SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SI ...
- [转载] Laya性能优化精选内容整理
第一是性能统计工具,这是LayaAir引擎内置的性能统计工具,在代码加入Laya.Stat.show(); 引擎内置的性能统计工具 打开这个工具后,可以用于观察性能,除了FPS越高越好外,其它的值越低 ...
- soa服务治理
SOA服务治理 文章:SOA 治理简介 文章:中小型互联网公司微服务实践-经验和教训
- LINUX远程强制重启/proc/sys/kernel/sysrq /proc/sysrq-trigger
1. # echo 1 > /proc/sys/kernel/sysrq 2. # echo b > /proc/sysrq-trigger 1. /proc/sys/ke ...
- 【Android】监听viewpager子页面里面的Button按钮
最近做项目遇到Viewpager+Fragment滑动页面,要监听子页面中的按钮,在网上查了些解决办法: 办法一: 这种方法是在适配器初始化中进行监听,有人亲测通过,但是我继承FragmentPage ...