很简单的水签到,耽误很长时间,自闭…

The ACM International Collegiate Programming Contest has been held in Vietnam for more than 10 years. The contest is a great chance for the students to meet new friends, broaden their knowledge and of course, win prizes.Every years, universities can send one or multiple teams to the contest and all universities hope to win prizes. The organizers want to define a rule to award the excellent contestants.The contest director decided to follow the World Finals policy by having 4 first prizes, 4 second prizes and 4 third prizes. 12 winners out of more than a hundred teams is also a good proportion to recognize the best students.Since universities can send multiple teams, we don’t want one university to swept all the awards. Thus, only the top team from a university can be awarded. It seems harsh for the second best team from one university but do not worry, they will still receive relevant certificates.The table below is the result of top 10 of Nha Trang Regional Contest 2016. The 4-th (team WINDOWS) and 8-th place (team UBUNTU) did not receive prizes because they were not the top team from University of Engineering and Technology - VNU. Team Metis and team BK.DeepMind are in the same situation.

Place

Institution

Team

Prize

1

Seoul National University

ACGTeam

First Prize

2

University of Engineering and Technology - VNU

LINUX

First Prize

3

Shanghai Jiao Tong University

Mjolnir

First Prize

4

University of Engineering and Technology - VNU

WINDOWS

5

National Taiwan University

PECaveros

First Prize

6

Hanoi University of Science and Technology

BK.Juniors
Second Prize
7
Ho Chi Minh City University of Science
HCMUS-Serendipity
Second Prize
8
University of Engineering and Technology - VNU
UBUNTU
9
Shanghai Jiao Tong University
Metis
10
Hanoi University of Science and Technology
BK.DeepMind
Given the final scoreboard of the contest, your task is to determine which 12 teams should be awarded prizes.
Input
The input starts with the number of teams N(12≤N≤200)
The i-th line of the next N lines contains information about the team that ranks i : the university name and the team name separated by a single space. Both names consists of digits, lowercase and uppercase English alphabet letters only. Both names does not exceed 20 letters in length.

It is guaranteed that there are at least 12 different universities.

Output

The output should contain 12 lines describing 12 winners. In each line, you should print the university name and the team name separated by a single space. The winners should be listed in the same order as the input.

Sample Input 1
30
Seoul ACGTeam
VNU LINUX
SJTU Mjolnir
VNU WINDOWS
NTU PECaveros
HUST BKJuniors
HCMUS HCMUSSerendipity
VNU UBUNTU
SJTU Metis
HUST BKDeepMind
HUST BKTornado
HCMUS HCMUSLattis
NUS Tourism
VNU DOS
HCMUS HCMUSTheCows
VNU ANDROID
HCMUS HCMUSPacman
HCMUS HCMUSGeomecry
UIndonesia DioramaBintang
VNU SOLARIS
UIndonesia UIChan
FPT ACceptable
HUST BKIT
PTIT Miners
PSA PSA
DaNangUT BDTTNeverGiveUp
VNU UNIXBSD
CanTho CTUA2LTT
Soongsil Team10deung
Soongsil BezzerBeater

Sample Output 1

Seoul ACGTeam
VNU LINUX
SJTU Mjolnir
NTU PECaveros
HUST BKJuniors
HCMUS HCMUSSerendipity
NUS Tourism
UIndonesia DioramaBintang
FPT ACceptable
PTIT Miners
PSA PSA
DaNangUT BDTTNeverGiveUp


#include <iostream>
#include <string>
#include <cstdio>
#include <map>
using namespace std;
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
const int N = 2005;
const int mod = 1e9 + 7;
string name[N];
map<string,int>flag;
int main()
{ios::sync_with_stdio(false);int n;cin >> n;int num = 0;rep(i, 1, n){string s1,s2;cin >> s1, s2;if(!flag[s1]){num++;flag[s1] = 1;cout<<s1<<' '<<s2<<endl;if(num == 12)break;       }}return 0;
}

I - ICPC Awards(字符串)相关推荐

  1. 一位计算机准PhD的大四和博零

    最新个人信息可见:Home - Zhuoning Guo 完整版请见:知乎 攻读PhD 大一开始有读博念头 大二计划去香港,理由:学制短,奖学金高,环境(导师和同学)容易适应,海外麻烦也申不到特别好的 ...

  2. 2013 ACM/ICPC Asia Regional Chengdu Online We Love MOE Girls 字符串STL 的应用

    题目来源: http://acm.hdu.edu.cn/showproblem.php?pid=4730 分析1:string s.substr(pos, n) 从 pos 开始 截取n个 字符 代码 ...

  3. 2019 ICPC EC Finals C. Heretical … Möbius(中国剩余定理,序列检验)

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 2018 ICPC EC Finals C. Heretical - Möbius Weblink h ...

  4. 2016 ACM / ICPC Asia dalian Regional Contest 题解(11 / 11)【每日亿题2021 / 2 / 17】

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A .(2017 ACM ICPC dalian H)To begin or not to be ...

  5. 2016年CCPC/ICPC比赛总结

    2016:我大一升入大二. 队友:GLY,WZK. 队名:开心就好(MyHappinessIsAll) 菜鸡战绩:5月省赛二等,9月东北四省赛二等,9月CCPC长春打铁,10月ICPC沈阳压线铜牌. ...

  6. [Python正则表达式] 字符串中xml标签的匹配

    现在有一个需求,比如给定如下数据: 0-0-0 0:0:0 #### the 68th annual golden globe awards #### the king s speech earns ...

  7. c语言字符串文库总结,C语言字符串.ppt

    C语言字符串.ppt ACM程序设计,福州大学至诚学院 冯新,第四讲,字符串处理,常用函数介绍,复制,char* strcpy char *s1, const char *s2; 将字符串s2复制到s ...

  8. 基础省选+NOI-第6部分 字符串

    1.Kmp KMP算法 KMP算法_哔哩哔哩_bilibili KMP算法计算next函数值(教材版,超简单!) KMP算法计算next函数值(教材版,超简单!)_哔哩哔哩_bilibili KMP算 ...

  9. ACM - ICPC World Finals 2013 A Self-Assembly

    原题下载 : http://icpc.baylor.edu/download/worldfinals/problems/icpc2013.pdf 这道题其实是2013年我AC的第一道题,非常的开心,这 ...

最新文章

  1. 概率论—随机变量的数字特征、大数定律及中心极限定理
  2. 即时与及时有什么区别_什么是即时配送它和快递有什么不同,镖滴新势力
  3. typescript数组,对象,接口实例
  4. checkPathValidity 检查所有agent的corridor的m_path是否有效
  5. PWM信号作用示例——调节台灯亮度
  6. Ubuntu 修改 ssh远程端口号
  7. java继承原理内存角度_Java编程的逻辑 (17) - 继承实现的基本原理
  8. 分享一下自己写的PHP函数
  9. c++中stack用法( 算法竞赛入门)
  10. CentOS7配置ssh证书登录无效
  11. linux看门狗机制
  12. 机械专业向机器人工程专业转型的可行性与前景分析
  13. Linux 各类软件整理汇总
  14. 百度点击算法核心内容大揭秘
  15. choose标签使用
  16. 小周个人博客之恋爱日记
  17. 阿里M8每天肝到凌晨,竟是只为一份文档把分布式到微服务讲清楚
  18. 【解决】source ~/.vimrc出错bash: /etc/vim/vimrc: line 21: syntax error near unexpected token `syntax'
  19. 首师大的计算机专业,首都师范大学计算机技术考研难吗
  20. Mac 终于有显示隐藏文件的快捷键了

热门文章

  1. Unity某个物体始终朝向相机
  2. 松鼠的新家(树上点差分 + LCA)
  3. ”我的2016“-太多难忘的第一次
  4. ORACLE 数据、表误删恢复(转)
  5. Nginx 配置图片反向代理
  6. Springboot集成mabatis-plus报com.xly.entity.ClientNot Found TableInfoCache.
  7. Inno Setup使用教程【收藏】
  8. php 圆柱体,认识圆柱体a href=http://ruiwen.com/friend/list.php(教师中心专稿)/a
  9. DELL电脑开机自检提示please run setup program
  10. 编写ringBuff过程中遇到的一次bug