对于这道水题本人觉得应该应用贪心算法来解这道题:

下面就贴出本人的代码吧:

 #include<cstdio>
#include<iostream>
using namespace std; int a[],b[]; int main(void)
{
int n;
int need = ;
int sum1 = ,sum2 = ;
for(int i=;i<=;++i){
scanf("%d",&a[i]);
sum1 += a[i];
}
for(int i=;i<=;++i){
scanf("%d",&b[i]);
sum2 += b[i];
}
scanf("%d",&n); if(sum1%!=) need += sum1/+;
else need += sum1/; if(sum2%!=) need += sum2/+;
else need += sum2/; if(need<=n) printf("YES\n");
else printf("NO\n"); return ;
}

对于这到题本人解决之后的想法就是一定要细心,本人就是因为粗心导致连提交两次都没有A掉这题。。。。。。。令人汗颜啊

Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告的更多相关文章

  1. Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)

    解题报告 意思就是说有n行柜子,放奖杯和奖牌.要求每行柜子要么全是奖杯要么全是奖牌,并且奖杯每行最多5个,奖牌最多10个. 直接把奖杯奖牌各自累加,分别出5和10,向上取整和N比較 #include ...

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

  3. Codeforces Round #360 (Div. 2) A. Opponents 水题

    A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...

  4. Codeforces Round #190 (Div. 2) 水果俩水题

    后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...

  5. Codeforces Round #282 (Div. 1) A. Treasure 水题

    A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A ...

  6. Codeforces Round #327 (Div. 2) B. Rebranding 水题

    B. Rebranding Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem ...

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

  8. Codeforces Round #377 (Div. 2) C. Sanatorium 水题

    C. Sanatorium time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  9. Codeforces Round #340 (Div. 2) B. Chocolate 水题

    B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everyt ...

随机推荐

  1. MySQL的EXPLAIN命令详解(转)

    explain显示了mysql如何使用索引来处理select语句以及连接表.可以帮助选择更好的索引和写出更优化的查询语句. 使用方法,在select语句前加上explain就可以了: 如: expla ...

  2. <a>作Form表单提</a>

    1. Form表单<%using (Html.BeginForm("AddRoles", "RoleManage", FormMethod.Post, n ...

  3. C# 正则获取html内容

    1.获取div内容 string str = "tt<u>ss</u><div id=\"test\"><div>< ...

  4. 一步步学习NHibernate(4)——多对一,一对多,懒加载(1)

    请注明转载地址:http://www.cnblogs.com/arhat 通过上一章的学习,我们学会如何使用NHibernate对数据的简单查询,删除,更新和插入,那么如果说仅仅是这样的话,那么NHi ...

  5. Linux安装包

    关于SWT SWT首先要在Eclipse中添加SWT的安装包:Windowsbuilder Pro.下载路径:http://www.eclipse.org/windowbuilder/download ...

  6. msisdn与imsi简介

    =======================================imsi========================================1 定义:imsi=MCC+MNC ...

  7. [转载]初学C#之list

    C# List<T>用法 所属命名空间:System.Collections.Generic public class List<T> : IList<T>, IC ...

  8. zepto源码学习-06 touch

    先上菜,看这个模块的最后一段代码,一看就明白. ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 't ...

  9. HDU4528+BFS

    /* bfs+标记状态 如何记录状态是关键!! */ #include<stdio.h> #include<string.h> #include<stdlib.h> ...

  10. 服务器部署_nginx报错: [warn] conflicting server name "www.test.com" on 0.0.0.0:80, ignored

    今天修改nginx配置文件nginx.conf之后,启动nginx就会报错.经仔细检查是重复配置了 server元素导致, 当nginx检测到重复的 server_name item.test.com ...