炒鸡\(6\)批的模拟题。

注意的是输入

把握好空格 大小写。

根据题目的这句话来排序

积分榜是按照以下原则制作的:胜利一个队得3分,平分1分,失败0分。
首先,球队按积分顺序排在积分榜上,分数相等比较净胜球,净胜球相等比较进球数。

排序的话 根据 分数 净胜球 进球数来排序

反正就是明白输入之后就很简单了

// score - > win - > ball 分别表示 分数净胜球 进球数
#include <bits/stdc++.h>
#define rep(i,j,n) for(register int i=j;i<=n;i++)
#define Rep(i,j,n) for(register int i=j;i>=n;i--)
#define low(x) x&(-x)
using namespace std ;
typedef long long LL ;
const int inf = INT_MAX >> 1 ;
inline LL In() { LL res(0) , f(1) ; register char c ;
#define gc c = getchar()
while(isspace(gc)) ; c == '-' ? f = - 1 , gc : 0 ;
while(res = (res << 1) + (res << 3) + (c & 15) , isdigit(gc)) ;
return res * f ;
#undef gc
} const int N = 50 + 5 ;
int n ;
struct node {
string name ;
int score ;
int win ;
int ball ;
}a[N] ;
map < string , int > score , win , ball ; bool cmp(node x , node y) {
// score - > win - > ball
if(x.score != y.score) return x.score > y.score ;
else {
if(x.win != y.win) return x.win > y.win ;
return x.ball > y.ball ;
}
}
bool cmp2(node x , node y) {
return x.name < y.name ;
}
inline void Ot() {
n = In() ;
rep(i,1,n) {
cin >> a[i].name ;
a[i].score = a[i].ball = a[i].win = 0 ;
}
rep(i,1,n*(n-1) >> 1) {
string s1 , s2 ;
register char c ;
//scanf("%s-%s %d:%d",&s1,&s2,&_1,&_2) ;
#define gc c = getchar()
while(isspace(gc)) ;
s1 += c ;
while(islower(gc) or isupper(c)) s1 += c ;
while(islower(gc) or isupper(c)) s2 += c ;
int x = In() , y = In() ;
if(x > y) score[s1] += 3 ;
if(x == y) score[s1] ++ , score[s2] ++ ;
if(x < y) score[s2] += 3 ;
win[s1] += (x - y) , win[s2] += (y - x) ;
ball[s1] += x , ball[s2] += y ;
}
rep(i,1,n) {
a[i].score = score[a[i].name] ;
a[i].ball = ball[a[i].name] ;
a[i].win = win[a[i].name] ;
}
sort(a+1,a+n+1,cmp) ;
sort(a+1,a+(n>>1)+1,cmp2) ;
rep(i,1,(n>>1)) cout << a[i].name << endl ;
}
signed main() {
// freopen("test.in","r",stdin) ;
return Ot() , 0 ;
}

随机推荐

  1. [HDU2136] Largest prime factor(素数筛)

    传送门 题意 给出若干个数n(n<=1000000),求每个n的最大质因子的排名. 质数的排名:如果素数p是第k小的素数,那么p的排名就是k. 思路 乍一看不知道怎么搞. 其实可以想想我们怎么筛 ...

  2. noip模拟赛 经营与开发

    题目描述 4X概念体系,是指在PC战略游戏中一种相当普及和成熟的系统概念,得名自4个同样以“EX”为开头的英语单词. eXplore(探索) eXpand(拓张与发展) eXploit(经营与开发) ...

  3. [NOIP2005] 提高组 洛谷P1054 等价表达式

    题目描述 明明进了中学之后,学到了代数表达式.有一天,他碰到一个很麻烦的选择题.这个题目的题干中首先给出了一个代数表达式,然后列出了若干选项,每个选项也是一个代数表达式,题目的要求是判断选项中哪些代数 ...

  4. 【NOIP2017】

    NOIP2015 省Rank136 NOIP2016 省Rank165 NOIP2017 求进省Rank前100

  5. c内存分配(转)

    图示 C内存分配 程序代码区 存放函数体的二进制代码 全局数据区 全局变量和静态变量的存储是放在一起的.初始化的全局变量和静态变量在一块区域,未初始化的全局变量和未初始化的静态变量在相邻的另一块区域. ...

  6. 【SQL Server 学习系列】-- 清除SQL Server 2012连接过的服务器名称

    需要删除两个地方,删除前请注意备份! 1.  %AppData%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin 2.  %A ...

  7. 程序猿是如何解决SQLServer占CPU100%的--马非码

    http://www.cnblogs.com/marvin/p/ASolutionForSQLServerCauseHighCPU.html

  8. 【CV论文阅读】+【搬运工】LocNet: Improving Localization Accuracy for Object Detection + A Theoretical analysis of feature pooling in Visual Recognition

    论文的关注点在于如何提高bounding box的定位,使用的是概率的预测形式,模型的基础是region proposal.论文提出一个locNet的深度网络,不在依赖于回归方程.论文中提到locne ...

  9. C# .NET想要另存一个项目,sln文件丢了怎么办

    如下图所示,我想要另存一个工程,把 V4.4整个的项目另存为V4.5,我可以把解决方案文件(.sln)改名字,但是我没法把文件夹改名字,改了打开sln就说找不到.   很简单的一个思路是反正sln是多 ...

  10. ZOJ 3819 Average Score 水

    水 Average Score Time Limit: 2 Seconds      Memory Limit: 65536 KB Bob is a freshman in Marjar Univer ...