#include <bits/stdc++.h>
using namespace std;
#define ll long long
int const N=2e5+5;
int const mod=1e9+7;
int main(){
int n;
cin>>n;
pair<int,string> con[n];
for (int i = 0; i < n; ++i)
{
cin>>con[i].second;
for (int j = 0; j < 5; ++j)
{
int a;
cin>>a;
con[i].first-=a;
}
// cout<<con[i].first<<' '<<con[i].second<<endl;
}
sort(con,con+n);
// for (int i = 0; i < n; ++i)
// {
// cout<<con[i].first<<' '<<con[i].second<<endl;
// }
pair<int,string> cur;
for (int i = 0; i < n; ++i)
{
cur=con[i];
//find best
cur.first-=500;
// con[i].first-=500;
int b=i,w=n-1;
for (int j = 0; j < i; ++j)
{
if(cur<con[j]){
b=j;
break;
}
}
cur.first+=1000;
// con[i].first+=1000;
for (int j = i+1; j < n; ++j)
{
if(cur<=con[j]){
w=j-1;
break;
}
}
// con[i].first-=500;
cout<<b+1<<' '<<w+1<<endl;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |