Codeforces 439A, the Singer and Churu, the Joker(水题)
题目链接:Codeforces 439A Devu, the Singer and Churu, the Joker
题目大意:Devu是一个歌唱家,Churu是个小丑,他们被共同邀请参加一个表演秀,Devu准备了n首歌曲,每首歌曲演唱需要ti时间,Churu负责讲笑话,每个笑话5分钟。现在节目的总时长为d,Devu每两首歌之间要休息10分钟,表演的总时间不能超过d,Churu非常亢奋,问Churu最多可以讲多少个笑话,前提是Devu必须唱完所有的歌,因为所有的人都是来听Devu唱歌的,否则输出-1。
解题思路:两首歌中间的10分钟肯定个Churu讲两个笑话,这样算时间有剩就都给Churu讲笑话用。如果这样都不够用那么久输出-1。
#include <cstdio>
#include <cstring>int main () {int n, d, t, s = 0;scanf("%d%d", &n, &d);for (int i = 0; i < n; i++) {scanf("%d", &t);s += t;}s += (n - 1) * 10;if (s > d)printf("-1\n");else {int tmp = d - s;printf("%d\n", n * 2 - 2 + tmp / 5);}return 0;
}
Codeforces 439A, the Singer and Churu, the Joker(水题)相关推荐
- codeforces 439A Devu, the Singer and Churu, the Joker
网址:点击打开链接 A. Devu, the Singer and Churu, the Joker time limit per test 1 second memory limit per tes ...
- Codeforces 439 A. Devu, the Singer and Churu, the Joker
纯属练习JAVA.... A. Devu, the Singer and Churu, the Joker time limit per test 1 second memory limit per ...
- Codeforces//Good Bye 2013//A. New Year Candles 水题
第一次在Codeforces上提交题,全是英文,啊.应该是场比赛,WA了两次,丫的.哎,什么时候才能不做水题了呢.Happy New Year!Zhou Ping!努力奋斗! 题目链接:A. New ...
- Codeforces Round #352 (Div. 2) A. Summer Camp 水题
A. Summer Camp 题目连接: http://www.codeforces.com/contest/672/problem/A Description Every year, hundred ...
- Codeforces Codeforces Round #319 (Div. 2) A. Multiplication Table 水题
A. Multiplication Table Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/57 ...
- Educational Codeforces Round 9 A. Grandma Laura and Apples 水题
A. Grandma Laura and Apples 题目连接: http://www.codeforces.com/contest/632/problem/A Description Grandm ...
- Codeforces Round #277 (Div. 2) A. Calculating Function 水题
A. Calculating Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/4 ...
- 【CodeForces - 1150A】Stock Arbitraging (贪心,水题)
题干: Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on ...
- Codeforces Round #360 (Div. 2) C. NP-Hard Problem 水题
C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari ...
最新文章
- dart系列之:手写Library,Library编写实践
- java选填_java基础填空选择题
- Dede cms文章内容管理系统安全漏洞!如何有效防止DEDE织梦系统被挂木马安全设置...
- eclipse启动发生Failed to load JNI shared library
- MongoDB未授权访问漏洞记录(端口:27017,37017)
- The 15th UESTC Programming Contest Preliminary K - Kidd1ng Me? cdoj1565
- Node.js 实现类似于.php,.jsp的服务器页面技术,自动路由
- leecode第三十题(串联所有单词的子串)
- atm系统的用例模型_ATM银行系统用例图.doc
- 使用nginx反向代理解决前端跨域问题
- adnroid中LayoutParams的简单总结
- 拓端tecdat|R语言中基于混合数据抽样(MIDAS)回归的HAR-RV模型预测GDP增长
- 如何设置mysql数据库连接池的大小
- 打开SQlite数据库
- Visio2013 Professional专业版密钥
- 【实战】替代Flash的,基于JQuery、HTML5文件上传插件
- innobackupex 简单使用笔记
- 如何使用CentOS linux来搭建u-email邮件服务器(AIIP全国技能大赛企业联合教程)
- 期末前端web大作业——HTML+CSS+JavaScript仿京东购物商城网页制作(7页)
- C语言经典面试题 与 C语言面试宝典
热门文章
- 【STM32F407学习笔记】GPIO(一)
- web测试工程师的工作职责(合集)
- debian php-fpn_如何在基于 Ubuntu 或 Debian 的 Linux 发行版中查看一个软件包的依赖...
- 电脑电池,电脑电池怎么用 电脑电池使用及更换电芯方法
- css app菜单,5种实用的移动手机APP导航菜单设计方案
- 相机中常见的噪声类型
- javaEE面试重点
- 【精品】12条核心知识带你了解机器学习
- 媛媛qq声音盒(yuanqqsound) v1.0 bt
- 【1106. 解析布尔表达式】