제출 #619918

#제출 시각아이디문제언어결과실행 시간메모리
619918errorgornMed (COCI22_med)C++17
50 / 50
10 ms384 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ii pair<ll,ll> #define fi first #define se second #define endl '\n' #define puf push_front #define pof pop_front #define pub push_back #define pob pop_back #define lb lower_bound #define ub upper_bound #define rep(x,s,e) for (auto x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e)?x++:x--)) #define all(x) (x).begin(),(x).end() #define sz(x) (int) (x).size() int n; string s[505]; int arr[505][5]; int brr[505]; signed main(){ cin.tie(0); cout.tie(0); cin.sync_with_stdio(false); cin>>n; rep(x,0,n){ cin>>s[x]; rep(y,0,5) cin>>arr[x][y]; rep(y,0,5) brr[x]+=arr[x][y]; } vector<int> idx; rep(x,0,n) idx.pub(x); //rep(x,0,n) cout<<brr[x]<<" "; cout<<endl; rep(x,0,n){ brr[x]+=500; sort(all(idx),[](int i,int j){ if (brr[i]!=brr[j]) return brr[i]>brr[j]; else return s[i]<s[j]; }); rep(y,0,n) if (idx[y]==x) cout<<y+1<<" "; brr[x]-=1000; sort(all(idx),[](int i,int j){ if (brr[i]!=brr[j]) return brr[i]>brr[j]; else return s[i]<s[j]; }); rep(y,0,n) if (idx[y]==x) cout<<y+1<<endl; brr[x]+=500; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...