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>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define eb emplace_back
#define int LL
using namespace std;
using LL = long long;
using pii = pair<int, int>;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
// nya ><
int n; cin >> n;
vector<pair<int, string>> v(n);
for(auto &i:v) {
string s; cin >> s;
int tot = 0;
For(_, 1, 5) {
int x; cin >> x;
tot += x;
}
i = make_pair(-tot, s);
}
vector<pair<int, string>> rk(all(v));
sort(all(rk));
// vector<int> l(n), r(n);
For(i, 0, n - 1) {
auto p = v[i];
p.F -= 500;
cout << (lower_bound(all(rk), p) - rk.begin() + 1) << " ";
p.F += 1000;
cout << (lower_bound(all(rk), p) - rk.begin()) << "\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |