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()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
vector<int> sum(n);
vector<string> s(n);
for(int i=0; i<n; i++)
{
cin>>s[i];
for(int j=0; j<5; j++)
{
int day;
cin>>day;
sum[i]+=day;
}
}
for(int i=0; i<n; i++)
{
int minn=n, maxx=n;
int misum=sum[i]+500, masum=sum[i]-500;
for(int j=0; j<n; j++)
{
if(i==j)
{
continue;
}
if(misum>sum[j]||(misum==sum[j]&&s[i]<s[j]))
{
minn--;
}
if(masum>sum[j]||(masum==sum[j]&&s[i]<s[j]))
{
maxx--;
}
}
cout<<minn<<" "<<maxx<<"\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |