#include <bits/stdc++.h>
using namespace std;
bool sup(pair<string,int> p,pair<string,int> p1)
{
return p.second>p1.second || (p.second==p1.second && p.first<p1.first);
}
int main()
{
int n;
cin>>n;
vector<pair<string,int>> sc(n);
for (int i=0;i<n;i++)
{
cin>>sc[i].first;
int x;
for (int j=0;j<5;j++)
{
cin>>x;
sc[i].second+=x;
}
}
for (int i=0;i<n;i++)
{
int r=1;
sc[i].second+=500;
for (int j=0;j<n;j++)
if (sup(sc[j],sc[i]))
r++;
sc[i].second-=500;
cout<<r<<' ';
r=1;
for (int j=0;j<n;j++)
{
sc[j].second+=500;
if (sup(sc[j],sc[i]))
r++;
sc[j].second-=500;
}
cout<<r<<endl;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
4 ms |
348 KB |
Output is correct |
6 |
Correct |
7 ms |
348 KB |
Output is correct |
7 |
Correct |
6 ms |
348 KB |
Output is correct |
8 |
Correct |
8 ms |
348 KB |
Output is correct |
9 |
Correct |
3 ms |
348 KB |
Output is correct |