题目链接: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(水题)相关推荐

  1. 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 ...

  2. 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 ...

  3. Codeforces//Good Bye 2013//A. New Year Candles 水题

    第一次在Codeforces上提交题,全是英文,啊.应该是场比赛,WA了两次,丫的.哎,什么时候才能不做水题了呢.Happy New Year!Zhou Ping!努力奋斗! 题目链接:A. New ...

  4. Codeforces Round #352 (Div. 2) A. Summer Camp 水题

    A. Summer Camp 题目连接: http://www.codeforces.com/contest/672/problem/A Description Every year, hundred ...

  5. 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 ...

  6. Educational Codeforces Round 9 A. Grandma Laura and Apples 水题

    A. Grandma Laura and Apples 题目连接: http://www.codeforces.com/contest/632/problem/A Description Grandm ...

  7. Codeforces Round #277 (Div. 2) A. Calculating Function 水题

    A. Calculating Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/4 ...

  8. 【CodeForces - 1150A】Stock Arbitraging (贪心,水题)

    题干: Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on ...

  9. Codeforces Round #360 (Div. 2) C. NP-Hard Problem 水题

    C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari ...

最新文章

  1. dart系列之:手写Library,Library编写实践
  2. java选填_java基础填空选择题
  3. Dede cms文章内容管理系统安全漏洞!如何有效防止DEDE织梦系统被挂木马安全设置...
  4. eclipse启动发生Failed to load JNI shared library
  5. MongoDB未授权访问漏洞记录(端口:27017,37017)
  6. The 15th UESTC Programming Contest Preliminary K - Kidd1ng Me? cdoj1565
  7. Node.js 实现类似于.php,.jsp的服务器页面技术,自动路由
  8. leecode第三十题(串联所有单词的子串)
  9. atm系统的用例模型_ATM银行系统用例图.doc
  10. 使用nginx反向代理解决前端跨域问题
  11. adnroid中LayoutParams的简单总结
  12. 拓端tecdat|R语言中基于混合数据抽样(MIDAS)回归的HAR-RV模型预测GDP增长
  13. 如何设置mysql数据库连接池的大小
  14. 打开SQlite数据库
  15. Visio2013 Professional专业版密钥
  16. 【实战】替代Flash的,基于JQuery、HTML5文件上传插件
  17. innobackupex 简单使用笔记
  18. 如何使用CentOS linux来搭建u-email邮件服务器(AIIP全国技能大赛企业联合教程)
  19. 期末前端web大作业——HTML+CSS+JavaScript仿京东购物商城网页制作(7页)
  20. C语言经典面试题 与 C语言面试宝典

热门文章

  1. 【STM32F407学习笔记】GPIO(一)
  2. web测试工程师的工作职责(合集)
  3. debian php-fpn_如何在基于 Ubuntu 或 Debian 的 Linux 发行版中查看一个软件包的依赖...
  4. 电脑电池,电脑电池怎么用 电脑电池使用及更换电芯方法
  5. css app菜单,5种实用的移动手机APP导航菜单设计方案
  6. 相机中常见的噪声类型
  7. javaEE面试重点
  8. 【精品】12条核心知识带你了解机器学习
  9. 媛媛qq声音盒(yuanqqsound) v1.0 bt
  10. 【1106. 解析布尔表达式】