Submission #222353

#TimeUsernameProblemLanguageResultExecution timeMemory
222353oolimryACM (COCI19_acm)C++14
50 / 50
8 ms384 KiB
#include <bits/stdc++.h> using namespace std; struct thonk{ int AC; long long penalty; string name; }; bool comp(thonk a, thonk b){ if(a.AC != b.AC) return a.AC > b.AC; else if(a.penalty != b.penalty) return a.penalty < b.penalty; else return a.name < b.name; } ///.-. int main(){ //freopen("i.txt","r",stdin); ios_base::sync_with_stdio(false); int n, m; cin >> n >> m; string me = "NijeZivotJedanACM"; string meme = me; vector<thonk> why; for(int i = 0;i <= n;i++){ string team; cin >> team; if(team == me){ me = "-1"; for(int i = 0;i < m;i++){ string s; cin >> s; } continue; } long long penalty = 0; int AC = 0; for(int i = 0;i < m;i++){ string s; cin >> s; if(s.size() <= 2) continue; AC++; long long WA = s[1] - '1'; long long hour = (s[3] - '0') * 10 + (s[4] - '0'); long long minute = (s[6] - '0') * 10 + (s[7] - '0'); long long second = (s[9] - '0') * 10 + (s[10] - '0'); penalty += WA * 60 * 20 + hour * 60 * 60 + minute * 60 + second; //cout << WA << " " << hour << " " << minute << " " << second << "|"; } why.push_back({AC,penalty,team}); //cout << team << " " << AC << " " << penalty << "\n"; } sort(why.begin(),why.end(),comp); for(int i = 0;i< (int)why.size();i++){ //cout << why[i].AC << " " << why[i].name <<"\n"; if(why[i].name == meme){ cout << i+1; return 0; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...