题目链接:http://codeforces.com/problemset/problem/750/A

750 A. New Year and Hurry

time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

题目描述
Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four hours, exactly until midnight. There will be n problems, sorted by difficulty, i.e. problem 1 is the easiest and problem n is the hardest. Limak knows it will take him 5·i minutes to solve the i-th problem.
Limak’s friends organize a New Year’s Eve party and Limak wants to be there at midnight or earlier. He needs k minutes to get there from his house, where he will participate in the contest first.
How many problems can Limak solve if he wants to make it to the party?

输入描述
Input
The only line of the input contains two integers n and k (1 ≤ n ≤ 10, 1 ≤ k ≤ 240) — the number of the problems in the contest and the number of minutes Limak needs to get to the party from his house.

输出描述
Output
Print one integer, denoting the maximum possible number of problems Limak can solve so that he could get to the party at midnight or earlier.

样例
Examples
Input
3 222
Output
2

Input
4 190
Output
4

Input
7 1
Output
7

Note
In the first sample, there are 3 problems and Limak needs 222 minutes to get to the party. The three problems require 5, 10 and 15 minutes respectively. Limak can spend 5 + 10 = 15 minutes to solve first two problems. Then, at 20:15 he can leave his house to get to the party at 23:57 (after 222 minutes). In this scenario Limak would solve 2 problems. He doesn’t have enough time to solve 3 problems so the answer is 2.
In the second sample, Limak can solve all 4 problems in 5 + 10 + 15 + 20 = 50 minutes. At 20:50 he will leave the house and go to the party. He will get there exactly at midnight.
In the third sample, Limak needs only 1 minute to get to the party. He has enough time to solve all 7 problems.

题意:晚上8点开始解决问题,解决的问题时间以5,10,15,20…变化,问在凌晨12点前能解决问题的数量。
思路:将剩余的4个小时也就是240分钟与需要解决的问题多花费的时间进行比较即可。

代码

#include <bits/stdc++>
using namespace std;
int main(){int N,K;cin>>N>>K;int T = 240 - K;int sum = 0;for(int i=1 ; i<=N ; i++){if(T>=i*5){sum++;T -= i*5;}else break;}printf("%d\n",sum);return 0;
}

A. New Year and Hurry相关推荐

  1. 枚举参考Hurry Up(三分)

    在写这篇文章之前,xxx已经写过了几篇关于改枚举参考主题的文章,想要了解的朋友可以去翻一下之前的文章 http://202.197.224.59/OnlineJudge2/index.php/Prob ...

  2. Android优雅的ui倒计时,Hurry - 一款颜值超高的日历+倒计时 APP - Android 应用 - 生活 - 【最美应用】...

    用过很多种倒计时 App 了,而今天要讲的这款 Android 应用「Hurry」,应该这么多同类型应用里的佼佼者了,不论是在颜值还是在易用性上. ▎具有视觉冲击的界面 作为一个自认审美在线的大龄青年 ...

  3. android倒计时日历软件,Hurry - 一款颜值超高的日历+倒计时 APP - Android 应用 - 纪念日 - 【最美应用】...

    用过很多种倒计时 App 了,而今天要讲的这款 Android 应用「Hurry」,应该这么多同类型应用里的佼佼者了,不论是在颜值还是在易用性上. ▎具有视觉冲击的界面 作为一个自认审美在线的大龄青年 ...

  4. New Year and Hurry

    文章目录 一. New Year and Hurry 总结 一. New Year and Hurry 本题链接:New Year and Hurry 题目: A. New Year and Hurr ...

  5. Android上好看的倒数日APP,Hurry:颜值超高的倒数日 App,让 Android 手机桌面好看 2 倍 #Android...

    想要纪念重要的日子,怎能不用倒数计日类 app? 然而 Android 上的倒计时 app 要么太鸡肋.复杂,要么不好看.最近   AppSo(微信公众号 AppSo)发现新上架了一款非常有颜值的倒数 ...

  6. android 酷炫倒计时,Hurry - 一个有颜值又好用的倒计时应用 - Android 应用 - 【最美应用】...

    我们生活中,总会有一些重要需要提醒的日子.可能是一场准备很久的旅行,可能是一次期待很久的演唱会,当然也可能只是一次约饭一次麻将.用过很多种倒计时的应用来提醒我,而今天要讲的这个「Hurry」,应该是我 ...

  7. Codeforces - 750A. New Year and Hurry

    题目链接:Codeforces - 750A. New Year and Hurry 直接计算就行,简单题 #include<string> #include<iostream> ...

  8. Android上好看的倒数日APP,颜值超高的倒数日 App,让 Android 手机桌面好看 2 倍 - Hurry #Android...

    作者:Karrypan 想要纪念重要的日子,怎能不用倒数计日类 app?然而 Android 上的倒计时 app 要么太鸡肋.复杂,要么不好看.最近   AppSo(微信公众号 AppSo)发现新上架 ...

  9. codeforces 750A New Year and Hurry

    题目描述: Limak is going to participate in a contest on the last day of the 2016. The contest will start ...

最新文章

  1. (cljs/run-at (JSVM. :all) 一次说白DataType、Record和Protocol)
  2. 启动代码格式:nginx安装目录地址 -c nginx配置文件地址
  3. 将Javascript带到边缘设备
  4. python编译exe运行慢_Python运行速度慢你知道这是为什么吗?
  5. MVC 自定义属性验证登录
  6. 网易云音乐工程师,亲自揭晓消息队列改造之路! | 技术头条
  7. python 提取网页正文_一篇文章教会你用Python爬取淘宝海量信息,把淘宝商品整理成一个表格...
  8. 寄云PaaS平台荣获“优秀创新项目奖”
  9. Xcode之developer tools access
  10. java回调函数(callBack)
  11. EEMD算法原理及应用
  12. Django 开发文档
  13. 宝健中国用产品缔造口碑,深受消费者信赖
  14. 对话腾讯天琴赵伟峰:当音乐与科技结合,会碰撞出怎样的火花?
  15. Leetcode每日一题2020.11.13第328题:奇偶链表
  16. 公有云 私有云 混合云
  17. JavaScript---BOM基础
  18. 分享一个好用的屏幕截取动图的工具
  19. vs2019测试sizeof(string)的长度是28
  20. java script 月日年转年月日_如何将这种格式的日期(2010年7月13日星期二00:00:00 CEST)转换为Java日期(字符串来自alfresco属性)...

热门文章

  1. C语言经典例题100道(辗转相除求最大公约数和最小公倍数)
  2. 【C++】辗转相除求最大公约数算法及原理
  3. c#字符串学习之祖玛游戏~
  4. GTD时间管理理念和德鲁克时间管理理念的异同
  5. 樱桃键盘cherry G80-3000不完全拆解
  6. 327 B. Hungry Sequence
  7. 两步路轨迹文件位置_两步路户外助手新手使用指南
  8. Unity3D常用游戏开发插件测评总结
  9. 泛微协同OA房地产行业解决方案
  10. 未来偶像的硬件破局:为爱买单,不为 AI 买单