# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
229222 | VEGAnn | ACM (COCI19_acm) | C++14 | 6 ms | 640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |