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定时器
存储过程
set and get 使用方法
getXxx setXxx入门理解
oracle数据字典
消息队列的两种模式
Cookie/Session机制详解
mysql千万级数据量根据索引优化查询速度
window7下配置python2.7+tornado3.3开发环境
priority queue优先队列初次使用
原文地址:https://www.cnblogs.com/Knuth/p/1562568.html
最新文章
TensorFlow 源码编译安装
深度学习框架介绍与比较
JVM 内存
[Python]如何使用HtmlTestRunner让自动化测试报告内容更丰富
静态方法和类成员方法(Python)
浅谈Apache性能调优
使用Jvisualvm监控JVM的内存、CPU、线程
Selenium WebDriver + Python 环境配置
如何使用不同参数组合生成独立的TestCase函数(Python)
Selenium的PO模式(Page Object Model)|(Selenium Webdriver For Python)
热门文章
Linux 基础(3)
Linux 基础(2)
linux 基础(1)
Python之路【第三篇】:Python基础(二)
Git基本操作
Ubuntu系统修改Python软链接
Caffe & Caffe2入门博客存档
看过的文档地址——个人留存
Visual Studio 安装OpenCV及问题总结
Python快速入门_1
Copyright © 2011-2022 走看看