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
;
}
查看全文
相关阅读:
(一)maven基本配置,概念,常用命令
redis 小结
git 小结
spring.xml
servlet web.xml学习笔记
springmvc小试牛刀
maven
springmvc学习笔记1
springmvcpojo
springmvc学习笔记
原文地址:https://www.cnblogs.com/Knuth/p/1562568.html
最新文章
html理解
问题
Error-Avoid non-default constructors in fragments```
DSA——二叉树习题笔记
Activity的资源及状态保存问题
剑指offer错误处理
关于java设计模式笔记
Binary XML file line #2: Error inflating class <unknown>
DSA——BST二叉搜索树/
Leetcode——60. Permutation Sequence笔记
热门文章
DSA——KMP算法字符匹配
IDE工具基本设置【eclipse】
(四)Lock,ReentrantLock,ReentrantReadWriteLock类的使用以及相关api---synchronized进阶
(三)(2)wait/notify实现生产者-消费者模型,join方法
(三)(1)线程间通信---wait和notify的使用
(七)mybatis批量操作,分页插件
(六)mybatis拦截器
Spring之IOC
(三)maven创建部署javaweb
(二)maven依赖,两个项目之间如何依赖,继承实现
Copyright © 2011-2022 走看看