// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define db long double
#define vll vector<pll>
#define F first
#define S second
#define endl '\n'
#define pb push_back
#define all(x) x.begin(), x.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int ll
int n, x, s[505];
string ss[505];
void fmain(){
cin >> n;
for(int i = 1; i <= n; i++){
cin >> ss[505];
for(int j = 1; j <= 5; j++){
cin >> x;
s[i] += x;
}
}
for(int i = 1; i <= n; i++){
int b = 1, w = 1;
for(int j = 1; j <= n; j++){
if(j == i) continue;
if(s[j] > s[i] + 500 or (s[j] == s[i] + 500 and ss[j] < ss[i])){
b++;
}
if(s[j] + 500 > s[i] or (s[j] + 500 == s[i] and ss[j] < ss[i])){
w++;
}
}
cout << b << " " << w << endl;
}
}
signed main(){
fastio;
int _ = 1;
// cin >> _;
while(_--){
fmain();
}
}
/*
2 1
3 10
*/
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |