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

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

 #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. Django数据操作

    1.一个模型类代表数据库中的一个表,一个模型类的实例代表这个数据库表中的一条特定的记录. 2.管理器和查询集. 查询集QuerySet表示从数据库中取出来的对象的集合.它可以含有零个.一个或者多个过滤 ...

  2. Collection和Collections的区别

    Collection 是集合类的上级接口,继承它的接口主要有set和list.Collections 是针对集合类的一个帮助类,他提供一系列静态方法实现对各种集合的搜索,排序,线程安全化等操作.

  3. 异步IO模型和Overlapped结构

    .NET中的 Overlapped 类 异步IO模型和Overlapped结构(http://blog.itpub.net/25897606/viewspace-705867/) 数据结构 OVERL ...

  4. 使用struts2标签<s:action无法显示引用页面问题

    使用过程中参考:http://www.cnblogs.com/lihuiyy/archive/2012/03/23/2411601.html 个人使用: 1.引用页面 <s:action nam ...

  5. 如何获取HttpServletResponse里面的内容

    背景:在SPRING 框架之中, 有一个服务端需要提供多种形态的服务,这里的多种形态只是返回值得展示形式(其实 数据内在逻辑完全一样), 比如: 形式1:   JSONP({“key1”: value ...

  6. Spatial Pyramid Matching 小结

    Spatial Pyramid Matching 小结 稀疏编码系列: (一)----Spatial Pyramid 小结 (二)----图像的稀疏表示——ScSPM和LLC的总结 (三)----理解 ...

  7. android对大图片的缓存处理

    废话不多说,直接上代码 package com.huge.emj.common.util; import java.io.File; import java.io.FileInputStream; i ...

  8. jav利用反射修改类的静态变量

    有Student这个类: public class Student { private static String schoolName=""; private static St ...

  9. MFC浅析(7) CWnd类虚函数的调用时机、缺省实现

    CWnd类虚函数的调用时机.缺省实现 FMD(http://www.fmdstudio.net) 1. Create 2. PreCreateWindow 3. PreSubclassWindow 4 ...

  10. Javascript实现摩斯码加密解密

    原文地址 作者:liaoyu 摩尔斯电码是一种时通时断的信号代码,通过不同的排列顺序来表达不同的英文字母.数字和标点符号,是由美国人萨缪尔·摩尔斯在1836年发明. 每一个字符(字母或数字)对应不同的 ...