UESTC 2018 Summer Training #4 Div.2
这次没去考试:就考试结尾场外交题了一道题。B题是补得。
因为和女朋友和好啦 开心 我以后要好好对她 不可以惹她生气了。好好学习。加油!
A
The ACM International Collegiate Programming Contest has been held in Vietnam for more than 1010 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 44 first prizes, 44 second prizes and 44 third prizes. 1212 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 1010 of Nha Trang Regional Contest 2016. The 44 -th (team WINDOWS) and 88 -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 |
11 |
Seoul National University |
ACGTeam |
First Prize |
22 |
University of Engineering and Technology - VNU |
LINUX |
First Prize |
33 |
Shanghai Jiao Tong University |
Mjolnir |
First Prize |
44 |
University of Engineering and Technology - VNU |
WINDOWS |
|
55 |
National Taiwan University |
PECaveros |
First Prize |
66 |
Hanoi University of Science and Technology |
BK.Juniors |
Second Prize |
77 |
Ho Chi Minh City University of Science |
HCMUS-Serendipity |
Second Prize |
88 |
University of Engineering and Technology - VNU |
UBUNTU |
|
99 |
Shanghai Jiao Tong University |
Metis |
|
1010 |
Hanoi University of Science and Technology |
BK.DeepMind |
Given the final scoreboard of the contest, your task is to determine which 1212 teams should be awarded prizes.
Input
The input starts with the number of teams NN (12≤N≤20012≤N≤200 ).
The ii -th line of the next NN lines contains information about the team that ranks ii : 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 2020 letters in length.
It is guaranteed that there are at least 1212 different universities.
Output
The output should contain 1212 lines describing 1212 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 | Sample Output 1 | ||||||||
---|---|---|---|---|---|---|---|---|---|
|
|
||||||||
A题很简单,一道HASH题即可。
B The tunnels of Cu Chi are an immense network of underground tunnels connecting rooms located in the Cu Chi District of Ho Chi Minh City. The Cu Chi tunnels were the location of several military campaigns in the 1960s. Nowadays, it is a popular tourist destination. There are documents from trusted sources about a private network of tunnels in this area used by a secret forces unit but it has not been discovered. According to the documents, this private network has NN rooms (numbered from 11 to NN ) connected by N−1N−1 bidirectional tunnels. Room 11 is the entry point from the ground surface to this underground network. From room 11 , you can follow the tunnels to go to any of the rooms. The rooms are numbered in such a way that, if you follow the shortest path from room 11 to any room XX , the sequence of visited rooms’ indices will be increasing. The image below shows a valid map of this network. The network below is invalid, since the path from 11 to 44 is 11 - 33 - 22 - 44 , which is not increasing: There is also an old article from an unknown source mentioning about DiDi which is the number of rooms directly connected to room ii . Given an array DD of size NN , your task is to verify if it is possible to have such a network. Input
OutputPrint YES/NO if it is possible/impossible to have such a network, respectively.
贪心题:主要不断加入尽可能小的且能加入的点(度数满足要求),没加入一次,两个点都减少1个度数,并把新的点加入图中(这里用set存图),加入的就map=1,以免下次使用的时候又把这个点加上了:比如第二层是2、3、4,2往下又加上了5、6,但是3往下也可以加5、6,但已经被加上了就不能加了。 最后判断度数是否都为0,中间有些情况可以提前结束判断。
E Parmida is a clever girl and she wants to participate in Olympiads this year. Of course she wants her partner to be clever too (although he's not)! Parmida has prepared the following test problem for Pashmak. There is a sequence a that consists of n integers a1, a2, ..., an. Let's denote f(l, r, x) the number of indices k such that: l ≤ k ≤ r and ak = x. His task is to calculate the number of pairs of indicies i, j (1 ≤ i < j ≤ n) such that f(1, i, ai) > f(j, n, aj). Help Pashmak with the test. Input The first line of the input contains an integer n (1 ≤ n ≤ 106). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109). Output Print a single integer — the answer to the problem. Examples Input 7 1 2 1 1 2 2 1 Output 8 Input 3 1 1 1 Output 1 Input 5 1 2 3 4 5 Output 0 E题是一道对我来说的一个总结性很强的题:有单独讲:https://blog.csdn.net/mxYlulu/article/details/81137457 |
UESTC 2018 Summer Training #4 Div.2相关推荐
- UESTC 2014 Summer Training #7 Div.2
DAY7一开始状态还行,最高纪录rank7,然后没力气了,一直跌到rank24,问题还是很多呐.昨天总结的问题依然很大. Problem A UVA 12377 就一开始还是慌了,没审清楚题意就去WA ...
- 2018 Multi-University Training Contest 3 Problem F. Grab The Tree 【YY+BFS】
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6324 Problem F. Grab The Tree Time Limit: 2000/1000 MS ...
- 2018 Multi-University Training Contest 4 Problem E. Matrix from Arrays 【打表+二维前缀和】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6336 Problem E. Matrix from Arrays Time Limit: 4000/20 ...
- 2020 BUPT Winter Training #1 Div.1
2020 BUPT Winter Training #1 Div.1 这些题真的很不错 读完题一道都不会 补完每一道都骂自己sb 文章目录 [A - Cover it!](https://vjudge ...
- Photoshop CC 2018 Essential Training: Design Photoshop CC 2018基本培训:设计 Lynda课程中文字幕
Photoshop CC 2018 Essential Training: Design 中文字幕 Photoshop CC 2018基本培训:设计 中文字幕Photoshop CC 2018 Ess ...
- ZBrush 2018 Essential Training ZBrush 2018基本培训 Lynda课程中文字幕
ZBrush 2018 Essential Training 中文字幕 ZBrush 2018基本培训 中文字幕ZBrush 2018 Essential Training ZBrush将3D建模,纹 ...
- Substance Painter 2018 Essential Training Substance Painter 2018基础教程 Lynda课程中文字幕
Substance Painter 2018 Essential Training 中文字幕 Substance Painter 2018基础教程 中文字幕Substance Painter 2018 ...
- Photoshop CC 2018 Essential Training: Photography Photoshop CC 2018基础培训:摄影 Lynda课程中文字幕
Photoshop CC 2018 Essential Training: Photography 中文字幕 Photoshop CC 2018基础培训:摄影 中文字幕Photoshop CC 201 ...
- Photoshop CC 2018 Essential Training: The Basics Photoshop CC 2018基本培训:基础 Lynda课程中文字幕
Photoshop CC 2018 Essential Training: The Basics 中文字幕 Photoshop CC 2018基本培训:基础 中文字幕Photoshop CC 2018 ...
最新文章
- 更简单的调试Release版本Optimize code的.NET程序集
- 几种常见的JVM调优场景(建议收藏)
- 通过 python-xmp-toolkit 读取图片xmlp信息
- jpeg6 安装问题!
- Redis:安装、配置、操作和简单代码实例(C语言Client端)[转]
- 网络工程师如何避免走弯路(二)
- char *转为pansichar
- 清华大学电机学答案_电机学清华大学答案
- SQL语句的优化建议
- 64位计算机安装xp,Windows XP(64位)如何安装语言包
- ubuntu linux多声卡设置默认声卡shell指令
- 银行专业术语解释说明 超级详细
- 最强推荐:阿里P7级别面试经验总结,进阶学习资料!
- 微生物组-扩增子16S分析和可视化(2023.2)
- 注塑模具设计的技术知识汇总
- postman tests获取cookie
- 特殊符号html怎么打出来的,特殊符号怎么打出来
- 图书馆管理系统Python+MySQL+tkinter图形化界面+管理员登录+学生登录(注释详细)
- C++, 多态应用举例之Word
- SRM- Golink体验报告