# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
339651 | Hazem | ACM (COCI19_acm) | C++14 | 7 ms | 492 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.
/*
ID: tmhazem1
LANG: C++14
TASK: pprime
*/
#include <bits/stdc++.h>
using namespace std;
#define S second
#define F first
#define LL long long
const int N = 1e3 + 10;
LL LINF = 100000000000000000;
LL INF = 1000000000;
vector<pair<pair<int,int>,string>>vec;
bool cmp(pair<pair<int,int>,string>p,pair<pair<int,int>,string>p1){
if(p.F.F!=p1.F.F)return p.F.F>p1.F.F;
if(p.F.S!=p1.F.S)return p.F.S<p1.F.S;
return p.S<p1.S;
}
int main()
{
//freopen("out.txt","w",stdout);
int n,m;
scanf("%d%d",&n,&m);
for(int i=1;i<=n+1;i++){
string s;
cin>>s;
int cnt = 0,pen = 0;
for(int j=1;j<=m;j++){
string r;cin>>r;
if(r[0]=='-')continue;
cnt++;
pen += (r[1]-'0'-1)*1200 + ((r[3]-'0')*10+(r[4]-'0'))*3600+((r[6]-'0')*10+(r[7]-'0'))*60+((r[9]-'0')*10+(r[10]-'0'));
}
if(s=="NijeZivotJedanACM"&&i!=n+1)continue;
vec.push_back({{cnt,pen},s});
}
sort(vec.begin(),vec.end(),cmp);
//reverse(vec.begin(),vec.end());
int idx = 0;
for(int i=0;i<vec.size();i++)
if(vec[i].S=="NijeZivotJedanACM")
idx = i+1;
printf("%d\n",idx);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |