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;
int main()
{
int n;
cin >> n;
string s[n];
int sc[n] = {};
for(int i = 0; i < n; i ++)
{
cin >> s[i];
for(int j = 0; j < 5; j++)
{
int x;
cin >> x;
sc[i] += x;
}
}
for(int i = 0; i < n; i ++)
{
pair<int, string> p1 = {-sc[i], s[i]};
pair<int, string> p2 = {-sc[i] - 500, s[i]};
int c1 = 0, c2 = 0;
for(int j = 0; j < n; j ++)
{
if(j == i) continue;
if(p1 < make_pair(-sc[j] - 500, s[j]))
c1++;
if(p2 < make_pair(-sc[j], s[j]))
c2++;
}
cout << n - c2 << ' ' << n - c1 << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |