Submission #484016

#TimeUsernameProblemLanguageResultExecution timeMemory
484016CSQ31ACM (COCI19_acm)C++17
50 / 50
5 ms460 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define fi first #define se second struct team{ string name; ll ac = 0,pen = 0; team(){} }; bool cmp(const team &a,const team &b){ if(a.ac!=b.ac)return a.ac > b.ac; if(a.pen!=b.pen)return a.pen < b.pen; return a.name < b.name; } int main() { int n,m; cin>>n>>m; vector<team>fuck; string ahhh = "NijeZivotJedanACM"; for(int i=0;i<=n;i++){ team f; cin>>f.name; for(int i=0;i<m;i++){ string s; cin>>s; if((int)(s.size())<=2)continue; if(s[0] != '-'){ f.ac++; //NijeZivotJedanACM ?1/04:42:43 - f.pen += (s[1] - '1') * 60 * 20; f.pen += (s[3] - '0') * 60 * 10 * 60; f.pen += (s[4] - '0') * 60 * 60; f.pen += (s[6] - '0') * 10 * 60; f.pen += (s[7] - '0') * 60; f.pen += (s[9] - '0') * 10; f.pen += (s[10] - '0'); } } //cout<<f.ac<<" "<<f.pen<<'\n'; if(i!=n && f.name == ahhh)continue; fuck.push_back(f); } sort(fuck.begin(),fuck.end(),cmp); for(int i=0;i<n;i++){ if(fuck[i].name == ahhh){ cout<<i+1; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...