# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
222354 | tqbfjotld | ACM (COCI19_acm) | C++14 | 15 ms | 384 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 n,m;
vector<pair<pair<int,int>,string> >v;
int main(){
cin>>n;
cin>>m;
for (int x = 0; x<n; x++){
string name;
cin>>name;
if (name=="NijeZivotJedanACM"){
for (int x = 0; x<m; x++){
string t;
cin>>t;
}
continue;
}
int qnum = 0;
int pen = 0;
for (int x = 0; x<m; x++){
string res;
cin>>res;
if (res[0]=='-'){
continue;
}
if (res[0]=='+'||res[0]=='?'){
qnum++;
int sub = res[1]-'0';
sub--;
pen += 1200*sub;
pen += 36000*(res[3]-'0');
pen += 3600*(res[4]-'0');
pen += 600*(res[6]-'0');
pen += 60*(res[7]-'0');
pen += 10*(res[9]-'0');
pen += (res[10]-'0');
}
}
qnum = -qnum;
v.push_back({{qnum,pen},name});
}
string name;
cin>>name;
int qnum = 0;
int pen = 0;
for (int x = 0; x<m; x++){
string res;
cin>>res;
if (res[0]=='-'){
continue;
}
if (res[0]=='+'){
qnum++;
int sub = res[1]-'0';
sub--;
pen += 1200*sub;
pen += 36000*(res[3]-'0');
pen += 3600*(res[4]-'0');
pen += 600*(res[6]-'0');
pen += 60*(res[7]-'0');
pen += 10*(res[9]-'0');
pen += (res[10]-'0');
}
}
qnum = -qnum;
v.push_back({{qnum,pen},name});
sort(v.begin(),v.end());
int c = 1;
for (auto x : v){
// printf("%d %d\n",x.first.first,x.first.second);
if (x.second=="NijeZivotJedanACM"){
printf("%d",c);
return 0;
}
c++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |