【比赛链接】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. Linux下如何从mysql数据库里导出导入数据

    https://blog.csdn.net/u012884402/article/details/47337701 一. 表的导入 1.进入数据库 mysql 数据库名 2.​查看表 show tab ...

  2. Ngnix SSL配置(HTTP、HTTPS兼容)

    一.使用阿里云提供证书 下载aliyun证书for Nginx,解压出两个文件,.pem和.key文件 在nginx安装目录Conf文件夹下新建cert文件夹,拷贝两个密钥文件 二.配置nginx 打 ...

  3. Masonry基础API

    Masonry基础API mas_makeConstraints()    添加约束 mas_remakeConstraints()  移除之前的约束,重新添加新的约束 mas_updateConst ...

  4. Alpha项目测试

    这个作业属于哪个课程 https://edu.cnblogs.com/campus/xnsy/SoftwareEngineeringClass1/homework/3338 这个作业要求在哪里 htt ...

  5. 梦想CAD控件安卓交互绘图

    在cad使用过程中,动态绘制的使用会使我们绘图速度大大加快.在此演示中,我们绘制了直线.多段线.点.样条线.圆.圆弧.椭圆.椭圆弧等实体. 用户可以在CAD控件视区任意位置绘制直线. 主要用到函数说明 ...

  6. 骑士游历 - dp

    题目地址:http://www.51cpc.com/web/problem.php?id=1586 Summarize: 1. 题目坐标系所给 x,y与惯用表示横纵坐标相反 2. 搜索超时,使用动规: ...

  7. C++STL快速入门学习

    C++ STL中最基本以及最常用的类或容器无非就是以下几个: string vector set list map 下面就依次介绍一下它们,并给出一些最常见的使用方法,做到最快入门. string 首 ...

  8. centos下kong源码安装

    参考资料: https://docs.konghq.com/install/source/ 环境准备:操作系统 centeros7.3 1 :openssl和pcre一般系统自带,如果没有可自己安装  ...

  9. springboot 生产环境不能访问swagger

    @Profile({"local", "dev", "test"}) local,dev, test 分支都可以访问swagger

  10. Spring Tool Suite 安装

    第一步:到http://spring.io/tools/sts/all/上下载对应版本.(此处以博主Windows64位系统为例) 第二步: 进入eclipse,依次点击help-->Insta ...