# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800950 | tlnk07 | Med (COCI22_med) | C++17 | 2 ms | 320 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;
long long n, a[501], x;
string s[501];
int main()
{
cin >> n;
for(int i = 1; i <= n; ++i)
{
cin >> s[i];
for(int j = 1; j <= 5; ++j)
{
cin >> x;
a[i] += x;
}
}
for(int i = 1; i <= n; ++i)
{
long long cnt1 = 1, cnt2 = 1;
for(int j = 1; j <= n; ++j)
{
if(i != j)
{
if(a[i] + 500 == a[j] && s[i] > s[j] || a[i] + 500 < a[j]) ++cnt1;
if(a[i] == a[j] + 500 && s[i] > s[j] || a[i] < a[j] + 500) ++cnt2;
}
}
cout << cnt1 << " " << cnt2 << "\n";
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |