###### PAT 1012. The Best Rank (25)

1.并列排名问题没有考虑，然后再改改，发现依然没有过。
2.平均数是+0.5之后的整数，然后依旧没过。

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<string>

using namespace std;

struct p
{
string StudentID;
}student[20005];

{
}

{
}

{
}

{
}

int main()
{
int n,m;
while(cin>>n>>m)
{
map<string,int> rank;
map<string,char> courses;
for(int i = 0; i < n; i++)
{
}
int grade = -1,ranks = 0;
for(int i = 0; i < n; i++)
{
{
ranks = i+1;
}
rank[student[i].StudentID] = ranks;
courses[student[i].StudentID] = 'A';
}
ranks = 0;
for(int i = 0; i < n; i++)
{
ranks = i+1;
if(ranks < rank[student[i].StudentID])
{
rank[student[i].StudentID] = ranks;
courses[student[i].StudentID] = 'C';
}
}
ranks = 0;
for(int i = 0; i < n; i++)
{
ranks = i+1;
if(ranks < rank[student[i].StudentID])
{
rank[student[i].StudentID] = ranks;
courses[student[i].StudentID] = 'M';
}
}
ranks = 0;
for(int i = 0; i < n; i++)
{
ranks = i+1;
if(ranks < rank[student[i].StudentID])
{
rank[student[i].StudentID] = ranks;
courses[student[i].StudentID] = 'E';
}
}
for(int i = 0; i < m; i++)
{
string id;
cin>>id;
map<string ,int>::iterator l_it;
l_it = rank.find(id);
if(l_it == rank.end())
{
cout<<"N/A"<<endl;
}else
{
cout<<rank[id]<<' '<<courses[id]<<endl;
}
}
}
return 0;
}

#### pat1012The Best Rank (25)

2015-10-02 19:45:07

#### 1012. The Best Rank (25)-PAT甲级真题

2016-08-13 22:39:41

#### PAT (Advanced Level) 1012. The Best Rank (25) 最佳排名，结构体排序，哈希查询

2015-07-20 13:45:56

#### 【PAT】1012. The Best Rank (25)

2013-08-27 11:37:46

#### [PAT]1012. The Best Rank (25)@Java

2017-08-29 14:28:43

#### 牛客网 PAT（甲级） 1012 Kuchiguse (20)

2017-06-15 14:14:15

#### PAT 1012. The Best Rank (25)

2017-07-25 21:09:40

#### 1012. The Best Rank (25)-PAT

2013-07-15 11:18:10

#### pat 1012. The Best Rank (25)

2013-08-27 09:31:15

#### [PAT]1012. The Best Rank (25)

2016-08-07 02:29:38

## 不良信息举报

PAT 1012. The Best Rank (25)