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 ...
随机推荐
- CentOS下的日志切割
在Linux下,日志会不停的增长,为了防止日志文件过大,导致我们无法在日志中快速找到想要的信息,我们会定时对日志文件进行切割.在这里我将使用logrotate切割日志. (1).logrotate的配 ...
- [leetcode DP]70. Climbing Stairs
一共有n个台阶,每次跳一个或者两个,有多少种走法,典型的Fibonacii问题 class Solution(object): def climbStairs(self, n): if n<0: ...
- dhcp 提示could not load neutron.agent
错误日志如下: N版存在问题,其它版本不知道 解决方法(代码问题): /usr/lib/python2.7/site-packages/neutron/common/utils.py 在这个方法上(d ...
- C语言初始化
注意:为什么要进行C语言环境的初始化?在没有进行C语言环境的初始化之前的初始化工作都是用汇编进行初始化的.比如核心初始化,和内存初始化 栈:栈帧:一个进程中一般会有多个函数,每一个函数都需要在内存中开 ...
- hdu 1514 记忆化搜索
题意是给4堆(堆的高度小于等于40)有颜色(颜色的种类小于等于20)的物品,你有一个篮子最多能装5件物品,每次从这4堆物品里面任取一件物品放进篮子里,但是取每堆物品时,必须先取上面的物品,才能取下面的 ...
- react中的children使用方法
使用过vue的小伙伴都知道vue中有个slot,也就是插槽,作用就是占位,那么再react中可以使用children来替代 父组件 render(){ return( <div> < ...
- git push时提示"fatal: The current branch master has no..."
git push到远程仓库时提示:fatal: The current branch master2 has no upstream branch. To push the current branc ...
- Solution for sending Whatsapp via sqlite "INSERT INTO"
I use something similar but thought I'd mention this 'bug' that can happen:when you INSERT '%wa_mess ...
- 通过adb把apk安装到系统分区
通过adb把apk安装到系统分区 以谷歌拼音为例:GooglePinyin1.4.2.apk提取出so文件libjni_googlepinyinime_4.solibjni_googlepinyini ...
- 常见 core dump 原因分析signal 11 - SIGSEGV
signal 6 - SIGABRT free 多次 char *p = malloc(100); free(p); free(p); fclose 多次 // fclose 内部调用 free FI ...