Submission #229222

#TimeUsernameProblemLanguageResultExecution timeMemory
229222VEGAnnACM (COCI19_acm)C++14
50 / 50
6 ms640 KiB
#include <bits/stdc++.h> #define MP make_pair #define MP3(a, b, c) MP(MP(a, b), c) #define PB push_back #define all(x) x.begin(),x.end() #define pii pair<int, int> #define piis pair<pii, string> #define ft first #define sd second using namespace std; string s; vector<piis> vc; int n, m; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); // freopen("in.txt","r",stdin); cin >> n >> m; for (int i = 0; i < n; i++){ cin >> s; int tim = 0, kol = 0; for (int i = 0; i < m; i++){ string s; cin >> s; if (s[0] == '-') continue; int pos = s.find('/'); tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')) * 60 * 60; pos += 3; tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')) * 60; pos += 3; tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')); pos += 3; tim += (s[1] - '0') * 20 * 60; kol++; } if (s != "NijeZivotJedanACM") vc.PB(MP3(-kol, tim, s)); } cin >> s; int tim = 0, kol = 0; for (int i = 0; i < m; i++){ string s; cin >> s; if (s[0] == '-') continue; int pos = s.find('/'); tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')) * 60 * 60; pos += 3; tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')) * 60; pos += 3; tim += ((s[pos + 1] - '0') * 10 + (s[pos + 2] - '0')); pos += 3; tim += (s[1] - '0') * 20 * 60; kol++; } vc.PB(MP3(-kol, tim, s)); sort(all(vc)); int nm = 0; while (vc[nm].sd != "NijeZivotJedanACM") nm++; cout << nm + 1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...