Codeforces Round #311 (Div. 2)A Ilya and Diplomas
来源:互联网 发布:二进制算法例子 编辑:程序博客网 时间:2024/05/01 17:26
【比赛链接】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;}/*61 52 63 7output1 2 3input101 21 31 5output2 3 5input61 32 22 2output2 2 2*/
0 0
- Codeforces Round #311 (Div. 2)A Ilya and Diplomas
- Codeforces Round #311 (Div. 2) A. Ilya and Diplomas
- A. Ilya and Diplomas( Codeforces Round #311 (Div. 2) )
- CodeForces#311 A. Ilya and Diplomas
- codeforces A. Ilya and Diplomas
- Codeforces 557A Ilya and Diplomas 【水题】
- CodeForces 557A-Ilya and Diplomas【模拟】
- CodeForces 557A Ilya and Diplomas
- CodeForces - 557A Ilya and Diplomas
- CodeForces 557A Ilya and Diplomas
- 【55.70%】【codeforces 557A】Ilya and Diplomas
- A. Ilya and Diplomas
- cf#311 A. Ilya and Diplomas
- coderforce A.Ilya and Diplomas
- Codeforces 557A Ilya and Diplomas 区间选数
- CodeForces - 557A Ilya and Diplomas (模拟)水
- 【CodeForces】557A - Ilya and Diplomas(水)
- Codeforces Round #293 (Div. 2)D. Ilya and Escalator
- nginx负载均衡配置的几种策略
- 如何在PL/SQL中修改ORACLE的字段顺序
- mysql总结
- c++中输出十进制,十六进制,八进制。默认输出十进制的数据和左右对齐
- Win7 ie的cookie存放路径
- Codeforces Round #311 (Div. 2)A Ilya and Diplomas
- 身后跌落的岁月
- 云计算的由来——开发过程和交付方式
- 关于签名
- 云计算名词解析
- 二分算法
- android sqlite的orm框架
- 14.04麒麟为/检查磁盘时发生严重错误的解决方法
- 无限互联学习连载七 数据库操作