# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
258885 | itiam | ACM (COCI19_acm) | C++11 | 11 ms | 512 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>
using namespace std;
#define pb push_back
#define parii pair<int,int>
vector <pair<parii,string>> v;
string nasTim="NijeZivotJedanACM";
int n,m;
int struint(string a){
int x=0;
for (auto w: a) x=x*10+w-'0';
return x;
}
parii racun(){
int cnt=0, pen=0;
string zad;
for (int i=0;i<m;i++){
cin >> zad;
if (zad[0]!='-'){
cnt++;
pen+=(zad[1]-'0'-1)*1200;
int h=struint(zad.substr(3,2));
int m=struint(zad.substr(6,2));
int sek=struint(zad.substr(9,2));
pen+=h*3600+m*60+sek;
}
}
return {-cnt, pen};
}
int main(){
string ime;
cin >> n >> m;
for (int i=0;i<n+1;i++){
cin >> ime;
auto r=racun();
if (ime!=nasTim) v.pb({r,ime});
else if(i==n) v.pb({r,ime});
}
sort(v.begin(),v.end());
for (int i=0;i<v.size();i++){ if(v[i].second==nasTim){ cout << i+1;break;}}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |