zoukankan
html css js c++ java
PKU 2153
Code
#pragma
warning (disable:4786)
#include
<
map
>
#include
<
string
>
#include
<
iostream
>
#include
<
algorithm
>
using
namespace
std;
typedef
struct
node
{
int
score;
char
name[
32
];
}
node;
node stu[
10000
];
int
main()
{
int
i,num1,num2,score;
scanf(
"
%d
"
,
&
num2);
getchar();
num1
=
num2;
char
str[
32
];
map
<
string
,
int
>
stu;
map
<
string
,
int
>
::iterator p;
while
(num2
--
)
{
gets(str);
stu[str]
=
0
;
}
scanf(
"
%d
"
,
&
num2);
while
(num2
--
)
{
for
(i
=
0
;i
<
num1;i
++
)
{
scanf(
"
%d
"
,
&
score);
getchar();
gets(str);
stu[str]
+=
score;
}
int
rank
=
1
;
int
temp
=
stu[
"
Li Ming
"
];
for
(p
=
stu.begin();p
!=
stu.end();p
++
)
{
if
(p
->
second
>
temp)
rank
++
;
}
printf(
"
%d\n
"
,rank);
}
return
0
;
}
查看全文
相关阅读:
hash算法
2020/9/30计算机硬件组成day3
NIO与IO区别
Collection.toArray()方法使用的坑&如何反转数组
Arrays.asList()使用指南
JDK8的LocalDateTime用法
Linux 删除文件夹和文件的命令
list集合为空或为null的区别
easyExcel使用
java Object 转换为 Long
原文地址:https://www.cnblogs.com/Knuth/p/1562568.html
最新文章
C++ STL之适配器(stack与queue的相互实现)
J.U.C之AbstractQueuedSynchronizer 抽象队列同步器
J.U.C之LockSupport
IDEA 常用快捷键
WebService接口拦截方案
c# 语法糖 yield
vs2013单元测试
HashTable与HashMap的区别
HashMap扩容-jdk1.9
Python学习教程系列
热门文章
Servlet-Api
类加载器
kafka
ForkJoinPool
线程池回收问题
ConcurrentSkipListMap
逻辑读、物理读
mysql表空洞
dependencyManagement
Calendar
Copyright © 2011-2022 走看看