제출 #704846

#제출 시각아이디문제언어결과실행 시간메모리
704846PixelCatMed (COCI22_med)C++14
50 / 50
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...