Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
using namespace std; int main()
{
double a[10],b[10],suma=0,sumb=0;
int n,i,j;
for(i=0; i<3; i++)
{
cin>>a[i];
suma+=a[i];
}
for(i=0; i<3; i++)
{
cin>>b[i];
sumb+=b[i];
}
cin>>n;
suma=ceil(suma/5);
sumb=ceil(sumb/10);
if(suma+sumb>n)
cout<<"NO"<<endl;
else cout<<"YES"<<endl;
return 0;
}
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
Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)的更多相关文章
- Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告
对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...
- Codeforces Round #185 (Div. 2) B. Archer 水题
B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...
- Codeforces Round #360 (Div. 2) A. Opponents 水题
A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...
- Codeforces Round #190 (Div. 2) 水果俩水题
后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...
- Codeforces Round #282 (Div. 1) A. Treasure 水题
A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A ...
- Codeforces Round #327 (Div. 2) B. Rebranding 水题
B. Rebranding Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem ...
- Codeforces Round #194 (Div. 1) B. Chips 水题
B. Chips Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/333/problem/B D ...
- Codeforces Round #377 (Div. 2) C. Sanatorium 水题
C. Sanatorium time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- Codeforces Round #340 (Div. 2) B. Chocolate 水题
B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everyt ...
随机推荐
- Xshell拖拽上传文件插件
lrzsz是一款在linux里可代替ftp上传和下载的程序.在linux中支持直接拖拽上传的插件:同时也支持rz和sz进行命令上传和下载. 插件安装 yum -y install lrzsz 上传(r ...
- Web应用扫描工具Wapiti
Web应用扫描工具Wapiti Wapiti是Kali Linux预置的一款Web应用扫描工具.该工具执行黑盒扫描,用户只需要输入要扫描的网址即可.该工具可以探测文件包含.数据库注入.XSS.CR ...
- 【20181031T2】几串字符【数位DP思想+组合数】
题面 [错解] 一眼数位DP 设\(f(i,c00,c01,c10,c11)\)-- 神tm DP 哎好像每两位就一定对应c中的一个,那不用记完 所以可以设\(f(i,c00,c01,c10)\)-- ...
- python 中__name__ = '__main__' 的作用,到底干嘛的?
python 中__name__ = 'main' 的作用,到底干嘛的? 有句话经典的概括了这段代码的意义: "Make a script both importable and execu ...
- 聊聊用CSS3来玩立方体
声明:本文为原创文章,如需转载,请注明来源WAxes,谢谢! 虽然现在很多浏览器都还不支持css3的3D转换,不过估计也已经有很多人都有玩css3的3D了......所以我这篇也就相当于水一下了,哈哈 ...
- SPOJ 10232. Distinct Primes
Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger i ...
- 嵌入式设备hacking(转)
原帖地址:http://drops.wooyun.org/papers/5157 0x00 IPCAM hacking TOOLS github-binwalk firmware-mod-kit ID ...
- 电感式升压转换器-AIC1896 电感式升压转换器
电感式升压转换器-AIC1896 AIC1896是一个脉冲宽度调变(Pulse-Width-Modulation;PWM)控制之升压型转换器,它可以提供一个定电流以驱动白光LED. (图五A)为升压转 ...
- 多线程调试必杀技 - GDB的non-stop模式
作者:破砂锅 (转) 开源的GDB被广泛使用在Linux.OSX.Unix和各种嵌入式系统(例如手机),这次它又带给我们一个惊喜. 多线程调试之痛 调试器(如VS2008和老版GDB)往往只支持a ...
- perf 工具介绍2
[root@localhost ~]# cat test1.c void longa() { int i,j; ; i < ; i++) j=i; //am I silly or crazy? ...