Submission #222349

#TimeUsernameProblemLanguageResultExecution timeMemory
222349errorgornACM (COCI19_acm)C++14
50 / 50
9 ms384 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ii pair<ll,ll> #define iii pair<ll,ii> #define endl '\n' struct dat{ string name; int first,second; dat(string _name,int _f,int _s){ name=_name; first=_f; second=_s; } }; int n,m; string s; vector<dat> v; dat add(dat i,dat j){ return dat(i.name,i.first+j.first,i.second+j.second); } dat parse(string s){ if (s.size()<=2) return dat("",0,0); else{ int time=(s[1]-'1')*1200; //time in seconds?? time+=(s[3]-'0')*36000; time+=(s[4]-'0')*3600; time+=(s[6]-'0')*600; time+=(s[7]-'0')*60; time+=(s[9]-'0')*10; time+=(s[10]-'0'); return dat("",1,time); } } int main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>n>>m; while (n--){ cin>>s; //trash v.push_back(dat(s,0,0)); for (int x=0;x<m;x++){ cin>>s; v.back()=add(v.back(),parse(s)); } if (v.back().name=="NijeZivotJedanACM") v.pop_back(); } cin>>s; dat res=dat(s,0,0); for (int x=0;x<m;x++){ cin>>s; res=add(res,parse(s)); } //cout<<"res: "<<res.first<<" "<<res.second<<endl; int ans=0; for (auto &it:v){ //cout<<it.first<<" "<<it.second<<endl; if (it.first>res.first) ans++; else if (it.first==res.first && it.second<res.second) ans++; else if (it.first==res.first && it.second==res.second && it.name<res.name) ans++; } cout<<ans+1<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...