This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
vector<pair<int,string>> con;
for (int i = 0; i < n; ++i)
{
con.push_back({0,"ief"});
cin>>con[i].second;
for (int j = 0; j < 5; ++j)
{
int a;
cin>>a;
con[i].first-=a;
}
}
vector<pair<int,string>> cp;
for (int i = 0; i < n; ++i)
{
con[i].first-=500;
cp=con;
sort(cp.begin(), cp.end());
for (int j = 0; j < n; ++j)
if(con[i]==cp[j]){
cout<<j+1<<' ';
break;
}
con[i].first+=1000;
cp=con;
sort(cp.begin(), cp.end());
for (int j = 0; j < n; ++j)
if(con[i]==cp[j]){
cout<<j+1<<endl;
break;
}
con[i].first-=500;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |