# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
704849 |
2023-03-03T05:31:39 Z |
guagua0407 |
Med (COCI22_med) |
C++17 |
|
1 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),greater<pair<pair<int,string>,int>>());
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=(lower_bound(all(vec),cur,greater<pair<pair<int,string>,int>>())-vec.begin())+1;
cur.f.f-=1000;
ans[id].s=(lower_bound(all(vec),cur,greater<pair<pair<int,string>,int>>())-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 |
1 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 |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |