Nasty Hacks <入门练手题>
Nasty Hacks |
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) |
Total Submission(s): 2047 Accepted Submission(s): 1280 |
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 |
Sample Output
advertise |
代码:
#include<stdio.h>
int main(void)
{
int n;
long a[3],t;
scanf("%d",&n);
while(n--)
{
scanf("%ld%ld%ld",&a[0],&a[1],&a[2]);
t=a[1]-a[0];
if(t>a[2]) printf("advertise\n");
else if(t==a[2]) printf("does not matter\n");
else printf("do not advertise\n");
}
}
注:使用while循环时应注意“循环结束”问题,不然会出现提交错误,如Output Limit Exceeded(超时)。
Nasty Hacks <入门练手题>的更多相关文章
- 微信小程序初体验,入门练手项目--通讯录,部署上线(二)
接上一篇<微信小程序初体验,入门练手项目--通讯录,后台是阿里云服务器>:https://www.cnblogs.com/chengxs/p/9898670.html 开发微信小程序最尴尬 ...
- 微信小程序初体验,入门练手项目--通讯录,后台是阿里云服务器(一)
内容: 一.前言 二.相关概念 三.开始工作 四.启动项目起来 五.项目结构 六.设计理念 七.路由 八.部署线上后端服务 同步交流学习社区: https://www.mwcxs.top/page/4 ...
- 推荐:一个适合于Python新手的入门练手项目
随着人工智能的兴起,国内掀起了一股Python学习热潮,入门级编程语言,大多选择Python,有经验的程序员,也开始学习Python,正所谓是人生苦短,我用Python 有个Python入门练手项目, ...
- Codevs 1287 矩阵乘法&&Noi.cn 09:矩阵乘法(矩阵乘法练手题)
1287 矩阵乘法 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 小明最近在为线性代数而头疼, ...
- Android Studio 插件开发详解一:入门练手
转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/78112003 本文出自[赵彦军的博客] 一:概述 相信大家在使用Android S ...
- python小练手题1
1. """ Write a program which can compute the factorial of a given numbers. The result ...
- Pandas数据分析练手题(十题)
数据集下载地址:https://github.com/Rango-2017/Pandas_exercises --------------------------------------------- ...
- NEXYS 3开发板练手--LED与数码管时钟
做科研的时候从学校拿到一块基于Xilinx公司Spartan-6主芯片的FPGA开发板,因为之前一直在用Altera公司的FPGA,一开始接触它还真有点不太习惯.但毕竟核心的东西还是不会变的,于是按照 ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
随机推荐
- How many ways??(HDU 2157)
How many ways?? Sample Input 4 4 //n个点,m条路径0 1 //s->t可通0 21 32 32 //询问数0 3 2 //从0到3走两条路可到的方案有多少种0 ...
- 【南阳OJ分类之语言入门】80题题目+AC代码汇总
小技巧:本文之前由csdn自动生成了一个目录,不必下拉一个一个去找,可通过目录标题直接定位. 本文转载自本人的csdn博客,复制过来的,排版就不弄了,欢迎转载. 声明: 题目部分皆为南阳OJ题目. 代 ...
- BIOS讲解
首先 BIOS其实没什么神奇的 就是 Bisic input/output System,所以基本输入输出系统是一块装入了启动和自检程序的EPROM或EEPROM集成块,实际上它是被固化在计算机R ...
- JS获取select的值
记录一下JS获取select的value值和选项值 <select id="video_status"> <option value="1" ...
- 使用POI把Word Excel转为HTML
此方法是针对Office2003的,但是word中如果有图片,图片能够解析出来但是HTML文件中不显示.也不支持excel中的图片解析. 所需jar包如下如下: 1:PoiUtil.java pack ...
- Codeforces 351B Jeff and Furik
http://codeforces.com/problemset/problem/351/B 题意:两个人轮流游戏,先手交换相邻两个数,后手先抛硬币,正面就左大右小换,反面就右大左小换,随机找到一对数 ...
- LeetCode_Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...
- C#中使用SendMessage进行进程通信的实例
原文:C#中使用SendMessage进行进程通信的实例 1 新建解决方案SendMessageSecondExample 在解决方案下面新建两个项目:Sender和Receiver,两者的输出类型均 ...
- BZOJ1689: [Usaco2005 Open] Muddy roads
1689: [Usaco2005 Open] Muddy roads Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 147 Solved: 107[Su ...
- NOI2010 海拔
http://www.lydsy.com/JudgeOnline/problem.php?id=2007 平面图网络流. 好吧,其实我只会暴力的网络流,并不会平面图网络流. Orz~ http://w ...