【比赛链接】click here~~

【题目大意】

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

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

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

A题,比較简单:

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

更新一下代码

代码:

  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int n,m;
  7. int a1,a2;
  8. int b1,b2;
  9. int c1,c2;
  10. while(cin>>n)
  11. {
  12. cin>>a1>>a2;
  13. cin>>b1>>b2;
  14. cin>>c1>>c2;
  15. int max1,max2,max3;
  16. max1=min(n-b1-c1,a2);
  17. max2=min(n-max1-c1,b2);
  18. max3=n-max1-max2;
  19. cout<<max1<<" "<<max2<<" "<<max3<<endl;
  20. }
  21. return 0;
  22. }
  23. /*
  24. 6
  25. 1 5
  26. 2 6
  27. 3 7
  28. output
  29. 1 2 3
  30. input
  31. 10
  32. 1 2
  33. 1 3
  34. 1 5
  35. output
  36. 2 3 5
  37. input
  38. 6
  39. 1 3
  40. 2 2
  41. 2 2
  42. output
  43. 2 2 2
  44. */

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. [Windows Server 2012] 初识Windows Server 2012

    ★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频.★ 本节我们将带领大家:初次见识Win ...

  2. ThinkPHP---TP功能类之邮件

    [一]概论 (1)简介: 这里说的邮件不是平时说的email邮件(邮件地址带有@符号的),而是指的一般论坛网站的站内信息,也叫私信或者pm(private message私信) [二]站内信案例 (1 ...

  3. gym101343 2017 JUST Programming Contest 2.0

    A.On The Way to Lucky Plaza  (数论)题意:m个店 每个店可以买一个小球的概率为p       求恰好在第m个店买到k个小球的概率 题解:求在前m-1个店买k-1个球再*p ...

  4. eBPF监控工具bcc系列一启航

    eBPF监控工具bcc系列一启航 在eBPF篇中,我们知道虽然可用 C 来实现 BPF,但编译出来的却仍然是 ELF 文件,开发者需要手动析出真正可以注入内核的代码.工作有些麻烦,于是就有人设计了 B ...

  5. 在TWaver的Tree节点上画线

    论坛上有同学提出如何在tree上画引导线,之前我们Flex已经实现此功能,现在最新版的HTML5也将添加此功能.先看看效果:详细的使用方法可以参考我们开发手册中可视化视图组件#Tree引导线一章,下面 ...

  6. python3连接mysql 稍微进阶 + 日期处理

    1.踩了个操作中文的坑,结果发现之前的文章中有强调了,在连接处加:charset="utf8" conn = pymysql.connect(host = '127.0.0.1', ...

  7. 教你如何使用Python写游戏辅助脚本

    主要实现方式是通过图片的对比,在游戏中就行点击.运行程序需要以下东西. PIL: 图片处理模块     (python3 换成了 pillow)  下载地址: https://www.lfd.uci. ...

  8. 第十一节:Web爬虫之数据存储(数据更新、删除、查询)

    接着上一节的内容 5.MySQL数据更新 结果是将id=3的name进行更新操作,结果如下: 6.MySQL数据去重及更新 结果是判断数据是否有重复的,如果有重复的将不再存储,若没有重复的就更新数据进 ...

  9. calculate Cp history (from Fluent) using Matlab

    input data : unscaled time history of moment/thrust from ANSYS fluent example of input data, "m ...

  10. 1031. Hello World for U

    Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. ...