Submission #222354

#TimeUsernameProblemLanguageResultExecution timeMemory
222354tqbfjotldACM (COCI19_acm)C++14
50 / 50
15 ms384 KiB
#include <bits/stdc++.h> using namespace std; int n,m; vector<pair<pair<int,int>,string> >v; int main(){ cin>>n; cin>>m; for (int x = 0; x<n; x++){ string name; cin>>name; if (name=="NijeZivotJedanACM"){ for (int x = 0; x<m; x++){ string t; cin>>t; } continue; } int qnum = 0; int pen = 0; for (int x = 0; x<m; x++){ string res; cin>>res; if (res[0]=='-'){ continue; } if (res[0]=='+'||res[0]=='?'){ qnum++; int sub = res[1]-'0'; sub--; pen += 1200*sub; pen += 36000*(res[3]-'0'); pen += 3600*(res[4]-'0'); pen += 600*(res[6]-'0'); pen += 60*(res[7]-'0'); pen += 10*(res[9]-'0'); pen += (res[10]-'0'); } } qnum = -qnum; v.push_back({{qnum,pen},name}); } string name; cin>>name; int qnum = 0; int pen = 0; for (int x = 0; x<m; x++){ string res; cin>>res; if (res[0]=='-'){ continue; } if (res[0]=='+'){ qnum++; int sub = res[1]-'0'; sub--; pen += 1200*sub; pen += 36000*(res[3]-'0'); pen += 3600*(res[4]-'0'); pen += 600*(res[6]-'0'); pen += 60*(res[7]-'0'); pen += 10*(res[9]-'0'); pen += (res[10]-'0'); } } qnum = -qnum; v.push_back({{qnum,pen},name}); sort(v.begin(),v.end()); int c = 1; for (auto x : v){ // printf("%d %d\n",x.first.first,x.first.second); if (x.second=="NijeZivotJedanACM"){ printf("%d",c); return 0; } c++; } }
#Verdict Execution timeMemoryGrader output
Fetching results...