이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |