Submission #704847

# Submission time Handle Problem Language Result Execution time Memory
704847 2023-03-03T05:29:45 Z guagua0407 Med (COCI22_med) C++17
0 / 50
0 ms 212 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define all(x) x.begin(),x.end()

int main(){
    int n;
    cin>>n;
    vector< pair< pair<int,string>, int> >  vec;
    for(int i=0;i<n;i++){
        int a,b,c,d,e;
        string S;
        cin>>S;
        cin>>a>>b>>c>>d>>e;
        vec.push_back({{a+b+c+d+e,S},i});
    }
    sort(all(vec));
    pair<int,int> ans[n];
    for(int i=0;i<n;i++){
        int sum=vec[i].f.f;
        string S=vec[i].f.s;
        int id=vec[i].s;
        pair<pair<int,string>,int> cur={{sum+500,S},id};
        ans[id].f=n-(lower_bound(all(vec),cur)-vec.begin())+1;
        cur.f.f-=1000;
        ans[id].s=n-(lower_bound(all(vec),cur)-vec.begin());
    }
    for(int i=0;i<n;i++){
        cout<<ans[i].f<<' '<<ans[i].s<<'\n';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -