# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
711607 | scottchou | ACM (COCI19_acm) | C++17 | 2 ms | 340 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;
int const N = 1005;
struct Person{
string name;
int p = 0, ac, id;
}a[N];
bool cmp(Person& x, Person& y){
if(x.ac != y.ac)
return x.ac > y.ac;
if(x.p != y.p)
return x.p < y.p;
return x.name < y.name;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
int nij = -1;
for(int i = 0; i < n; i++){
cin >> a[i].name;
string st;
a[i].id = i;
if(a[i].name == "NijeZivotJedanACM"){
nij = i;
for(int j = 0; j < m; j++){
cin >> st;
}
continue;
}
for(int j = 0; j < m; j++){
cin >> st;
if(st[0] == '-')
continue;
a[i].ac++;
a[i].p += (st[1] - '0' - 1) * 1200;
a[i].p += (st[4] - '0') * 3600 + (st[6] - '0') * 600 + (st[7] - '0') * 60 + (st[9] - '0') * 10 + (st[10] - '0');
}
}
cin >> a[nij].name;
string st;
for(int j = 0; j < m; j++){
cin >> st;
if(st[0] == '-')
continue;
a[nij].ac++;
a[nij].p += (st[1] - '0' - 1) * 1200;
a[nij].p += (st[4] - '0') * 3600 + (st[6] - '0') * 600 + (st[7] - '0') * 60 + (st[9] - '0') * 10 + (st[10] - '0');
}
sort(a, a + n, cmp);
for(int i = 0; i < n; i++){
if(a[i].id == nij){
cout << i + 1 << '\n';
break;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |