【比赛链接】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. CAD使用GetxDataString读数据(网页版)

    主要用到函数说明: MxDrawEntity::GetxDataString2 读取一个字符扩展数据,详细说明如下: 参数 说明 [in] LONG lItem 该值所在位置 [out, retval ...

  2. (独孤九剑)--MySQL入门

    :[一]概论 (1)什么是 MySQL? 一种关系型开源数据库,定义了存储信息的结构. 在数据库中,存在着一些表.类似 HTML 表格,数据库表含有行.列以及单元. 在分类存储信息时,数据库非常有用. ...

  3. 如何使用fio模拟线上环境

    线上表现 这里我想通过fio来模拟线上的IO场景,那么如何模拟呢? 首先使用iostat看线上某个盘的 使用情况,这里我们需要关注的是 avgrq-sz, avgrq-qz. #iostat -dx ...

  4. UVA - 247 Calling Circles(Floyd求传递闭包)

    题目: 思路: 利用Floyd求传递闭包(mp[i][j] = mp[i][j]||(mp[i][k]&&mp[k][j]);),当mp[i][j]=1&&mp[j][ ...

  5. buf.writeInt8()函数详解

    buf.writeInt8(value, offset[, noAssert]) value {Number} 需要被写入到 Buffer 的字节 offset {Number} 0 <= of ...

  6. python3 时间模块 random模块之两个小练习

    话不多说,一个是算时间的,还有一个是生成验证码的 #!usr/bin/env/ python # -*- coding:utf-8 -*- # Author: XiaoFeng import time ...

  7. Linux命令介绍

    资料链接:(Linux基本命令介绍)http://note.youdao.com/share/?id=36c07917f8d3e6437c1e764c3516a3f2&type=note#/ ...

  8. free web rich code eidtor

    free web rich code eidtor https://i.cnblogs.com/Preferences.aspx tiny code-editor https://apps.tiny. ...

  9. spring boot & JsonParser

    spring boot https://stackoverflow.com/questions/29313687/trying-to-use-spring-boot-rest-to-read-json ...

  10. [luoguP1026] 统计单词个数(DP)

    传送门 题解 #include <cstdio> #include <cstring> #define max(x, y) ((x) > (y) ? (x) : (y)) ...