cf448A Rewards
1 second
256 megabytes
standard input
standard output
Bizon the Champion is called the Champion for a reason.
Bizon the Champion has recently got a present — a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medals and cups. Bizon the Champion has a1 first prize cups, a2 second prize cups and a3third prize cups. Besides, he has b1 first prize medals, b2 second prize medals and b3 third prize medals.
Naturally, the rewards in the cupboard must look good, that's why Bizon the Champion decided to follow the rules:
- any shelf cannot contain both cups and medals at the same time;
- no shelf can contain more than five cups;
- no shelf can have more than ten medals.
Help Bizon the Champion find out if we can put all the rewards so that all the conditions are fulfilled.
The first line contains integers a1, a2 and a3 (0 ≤ a1, a2, a3 ≤ 100). The second line contains integers b1, b2 and b3 (0 ≤ b1, b2, b3 ≤ 100). The third line contains integer n (1 ≤ n ≤ 100).
The numbers in the lines are separated by single spaces.
Print "YES" (without the quotes) if all the rewards can be put on the shelves in the described manner. Otherwise, print "NO" (without the quotes).
1 1 1
1 1 1
4
YES
1 1 3
2 3 4
2
YES
1 0 0
1 0 0
1
NO
额……好久没刷cf了
第一题模拟一下
#include<cstdio>
#define LL long long
using namespace std;
inline int read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
LL a,b,c,d,e,f,g,h,n;
int main()
{
scanf("%lld%lld%lld%lld%lld%lld",&a,&b,&c,&d,&e,&f);
g=a+b+c;
h=d+e+f;
scanf("%lld",&n);
if (g%5)n--;
if (h%10)n--;
if (g/5+h/10<=n) printf("YES");
else printf("NO");
return 0;
}
cf448A Rewards的更多相关文章
- codeforces #256 A. Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- Codeforces Round #256 (Div. 2) A. Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- 45 The Effect of External Rewards on Behavior 外界奖励对行为的影响
The Effect of External Rewards on Behavior 外界奖励对行为的影响 ①Psychologists take opposing views on how exte ...
- CF#256(Div.2) A. Rewards
A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...
- Would Your Work Habits Change if You Were Paid by the Job?
原文地址:http://success-sys.com/2016/09/26/would-your-work-habits-change-if-you-were-paid-by-the-job/ A ...
- 7 COMPELLING REASONS YOU NEED TO START THE BUSINESS YOU’VE ALWAYS WANTED
原文链接:http://lesseesadvocate.com/7-compelling-reasons-need-start-business-youve-always-wanted/ Don’t ...
- Machine Learning Algorithms Study Notes(5)—Reinforcement Learning
Reinforcement Learning 对于控制决策问题的解决思路:设计一个回报函数(reward function),如果learning agent(如上面的四足机器人.象棋AI程序)在决定 ...
- Codeforces Round #256 (Div. 2)
A - Rewards 水题,把a累加,然后向上取整(double)a/5,把b累加,然后向上取整(double)b/10,然后判断a+b是不是大于n即可 #include <iostream& ...
- POMDP
本文转自:http://www.pomdp.org/ 一.Background on POMDPs We assume that the reader is familiar with the val ...
随机推荐
- Delphi TcxTreeListColumn 的 ImageComboBox 用法
1.设置图片如下: 设置默认值: if Trim(FQuery.fieldByName('cPersonCategory').AsString) = '' then begin CNode.Value ...
- C++链接器工具错误:LNK2001, LNK2019(转载)
这是归属于链接器工具错误 这一类. 无法解析的外部符号“symbol” 代码引用了链接器无法在库和对象文件中找到的内容(如函数.变量或标签). 可能的原因 代码请求的内容不存在(例如,符号拼写错误或使 ...
- openStack kilo 手动Manual部署随笔记录
一 ,基于neutron网络资源主机(控制节点,网络节点,计算节点)网络规划配置 1, controller.cc 节点 网络配置截图
- C++类静态成员的初始化和用法探讨
一.一般类型的类的静态变量 1.首先看下面的代码: class CTest1 { public: static int m_num1; void printNum(){cout << m_ ...
- amcharts报表制作
fusioncharts官网:http://www.fusioncharts.com/demos/gallery/#column-and-bar 最近使用amcharts fb4,flashBuild ...
- python网络请求简洁之道--python requests简介
#requests中文文档:http://cn.python-requests.org/en/latest/#学习出处:http://mp.weixin.qq.com/s?__biz=MjM5NzU0 ...
- sql加强练习
1.用一条SQL语句 查询出每门课都大于80分的学生姓名 name kecheng fenshu 张三 语文 81张三 数学 75李四 语文 76李四 数学 90王五 语文 81王五 数学 100王五 ...
- IOS详解TableView——选项抽屉(天猫商品列表)
在之前的有篇文章讲述了利用HeaderView来写类似QQ好友列表的表视图. 这里写的天猫抽屉其实也可以用该方法实现,具体到细节每个人也有所不同.这里采用的是点击cell对cell进行运动处理以展开“ ...
- JMeter 参数化、检查点、集合点
参数化:简单的来理解一下,我们录制了一个脚本,这个脚本中有登录操作,需要输入用户名和密码,假如系统不允许相同的用户名和密码同时登录,或者想更好的模拟多个用户来登录系统. 这个时候就需要对用户名和密 ...
- 绘制更Smooth的UI
以前很长一段时间,在自定义控制绘制时,只是简单的定义一个QPainter对象而开始绘画.经常会画一些圆角矩形,甚至是一些不规则的图形.对于不规则的图形来说,如果PS技术不好,或者mask制作的不好,常 ...