# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
660240 | berr | Med (COCI22_med) | C++17 | 1 ms | 352 KiB |
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 int long long
int cmp(string x, string y)
{
for(int i=0; i<min(x.size(), y.size()); i++)
{ cout<<x[i]<<" "<<y[i]<<"\n";
if(x[i]<y[i]) return 1;
if(y[i]<x[i]) return 0;
}
return x.size()<y.size();
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n; cin>>n;
vector<int> tot(n);
vector<string> s(n);
for(int i=0; i<n; i++)
{
cin>>s[i];
for(int l=0; l<5; l++)
{
int x; cin>>x;
tot[i]+=x;
}
}
for(int i=0; i<n; i++)
{
int r=n, j=n;
int v=tot[i]+500, z=tot[i]-500;
for(int l=0; l<n; l++)
{
if(i==l) continue;
if(v>tot[l]||(v==tot[l]&&s[i]<s[l])) r--;
if(z>tot[l]||(z==tot[l]&&s[i]<s[l])) j--;
}
cout<<r<<" "<<j<<"\n";
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |