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
;
}
查看全文
相关阅读:
算法练习:求字符串的最长重复子串(Java实现)
Oracle数据库中遇到的坑
解决Oracle死锁问题步骤
转:Spring Cache抽象详解
Spring MVC测试框架详解——服务端测试
转:SpringMVC中日期格式的转换
freemarker判断是否为空
jQuery Pagination分页插件
Java链式方法
mysql强制索引和禁止某个索引
原文地址:https://www.cnblogs.com/Knuth/p/1562568.html
最新文章
[sql]mysql5.6cmake安装/mysql5.7二进制安装
[sql]生产库全备/mysql库体积大小查看
[svc]通过ssh tunnel连接内网ECS和RDS
jmeter if 控制器
jmeter 302请求测试
redis专题--slow log详解
jmeter 异步子请求测试随笔
SpringMVC学习系列-后记 解决GET请求时中文乱码的问题
spring mvc 基于注解的使用总结
java volatile 和Transient 关键字
热门文章
iftop 使用
Mysql 1030 Got error -1 from storage engine 错误解决
MySQL.. ERROR! The server quit without updating PID file问题解决
nio再学习之通道channel
Nio再学习之NIO的buffer缓冲区
在JSON中遇到的一些坑
nginx+腾讯云免费ssl证书+阿里云ECS实现Https配置
通俗易懂的来理解Iaas,Paas,SaaS
Java中数组判断元素存在几种方式比较详解
kafka问题集锦
Copyright © 2011-2022 走看看