【比赛链接】click here~~

【题目大意】

n个人,获取一到三等文凭,每门文凭有大小范围。求最后文凭各颁发多少

【解题思路】直接枚举了,

看完题,赶紧写了一发代码,发现竟然错过注冊时间。系统提示不能提交代码。真是醉了~~。以后还是得提前注冊:

A题,比較简单:

我去,昨天发的代码早上交上去竟然WA了,简直打脸~~

更新一下代码

代码:

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
int a1,a2;
int b1,b2;
int c1,c2;
while(cin>>n)
{
cin>>a1>>a2;
cin>>b1>>b2;
cin>>c1>>c2;
int max1,max2,max3;
max1=min(n-b1-c1,a2);
max2=min(n-max1-c1,b2);
max3=n-max1-max2;
cout<<max1<<" "<<max2<<" "<<max3<<endl;
}
return 0;
}
/*
6
1 5
2 6
3 7
output
1 2 3
input
10
1 2
1 3
1 5
output
2 3 5
input
6
1 3
2 2
2 2
output
2 2 2
*/

Codeforces Round #311 (Div. 2)A Ilya and Diplomas的更多相关文章

  1. Codeforces Round #311 (Div. 2) A. Ilya and Diplomas 水题

    A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/ ...

  2. Codeforces Round #297 (Div. 2)C. Ilya and Sticks 贪心

    Codeforces Round #297 (Div. 2)C. Ilya and Sticks Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  ...

  3. 贪心 Codeforces Round #297 (Div. 2) C. Ilya and Sticks

    题目传送门 /* 题意:给n个棍子,组成的矩形面积和最大,每根棍子可以-1 贪心:排序后,相邻的进行比较,若可以读入x[p++],然后两两相乘相加就可以了 */ #include <cstdio ...

  4. 递推 Codeforces Round #186 (Div. 2) B. Ilya and Queries

    题目传送门 /* 递推:用cnt记录前缀值,查询区间时,两个区间相减 */ #include <cstdio> #include <algorithm> #include &l ...

  5. A. Ilya and Diplomas( Codeforces Round #311 (Div. 2) )

    A. Ilya and Diplomas time limit per test 1 second memory limit per test 256 megabytes input standard ...

  6. Codeforces Round #311 (Div. 2)

    我仅仅想说还好我没有放弃,还好我坚持下来了. 最终变成蓝名了,或许这对非常多人来说并不算什么.可是对于一个打了这么多场才好不easy加分的人来说,我真的有点激动. 心脏的难受或许有点是由于晚上做题时太 ...

  7. Codeforces Round #311 (Div. 2) A,B,C,D,E

    A. Ilya and Diplomas 思路:水题了, 随随便便枚举一下,分情况讨论一下就OK了. code: #include <stdio.h> #include <stdli ...

  8. Codeforces Round #311 (Div. 2)题解

    A. Ilya and Diplomas time limit per test 1 second memory limit per test 256 megabytes input standard ...

  9. [Codeforces Round #186 (Div. 2)] B. Ilya and Queries

    B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

随机推荐

  1. java设计模式之策略模式总结

    策略模式的定义:(定义截自http://www.cnblogs.com/whgk/p/6087064.html) 1.策略模式定义了算法族,分别封装起来,让他们之间可以互相替换,此模式让算法的变化独立 ...

  2. SpringBoot(1.5.6.RELEASE)源码解析

    转自 https://www.cnblogs.com/dylan-java/p/7450914.html 启动SpringBoot,需要在入口函数所在的类上添加@SpringBootApplicati ...

  3. arx 插入图片

    #include <ShLwApi.h> #pragma comment(lib, "ShLwApi.lib") //插入影像图 Acad::ErrorStatus i ...

  4. 梦想CAD控件 2018.7.26更新

    下载地址: http://www.mxdraw.com/ndetail_107.html 1.  增加属性匹配功能 2.  增加List命令 3.  增加CAD图纸审图批注功能 4.  环形阵列功能 ...

  5. QuickClip—界面原型设计

    1.需不需要设置用户登录/注册页? QuickClip没有提供该项功能.因为本产品为单纯的移动端视频编辑软件,是一个工具类软件.而且移动端软件本就追求的是方便快捷.简单易用,本产品不需要标识使用者的身 ...

  6. poj - 3254 - Corn Fields (状态压缩)

    poj - 3254 - Corn Fields (状态压缩)超详细 参考了 @外出散步 的博客,在此基础上增加了说明 题意: 农夫有一块地,被划分为m行n列大小相等的格子,其中一些格子是可以放牧的( ...

  7. 透彻分析C/C++中memset函数

    在C语言中,经常需要对内存进行操作,里面涉及很多函数,但是memset函数的使用有一点需要大家格外注意,这也是我在做项目时遇到过的一个问题,调试了很久才找出来错误. 函数原型是:void *memse ...

  8. java 访问对象私有变量

    Captcha captcha = getCaptcha(captchaId); // 通过反射获取验证码值 Class<?> classType = captcha.getClass() ...

  9. Entity SQL rules for Wrapped and Unwrapped Results

    Here are some rules to remember for Entity SQL queries: 1.Use SELECT VALUE when projecting more than ...

  10. 【Codeforces 356A】Knight Tournament

    [链接] 我是链接,点我呀:) [题意] n个人矩形m场比赛 每场比赛由编号为li~ri且之前没有被淘汰的人进行. 已知第i场的winner是xi winner会把这一场其他所有的人都淘汰. 问你n个 ...