# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
576348 | AGE | ACM (COCI19_acm) | C++14 | 26 ms | 31872 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 int long long
#define F first
#define S second
#define pb push_back
using namespace std;
const int N=1e6,M=3e3+2,mod=1e9+7;
int a[N];
string ss[N];
int num[N],ans[N];
main()
{
int n,m;
cin>>n>>m;
int index;
for(int i=0; i<n; i++)
{
cin>>ss[i];
for(int j=0; j<m; j++)
{
string s;
cin>>s;
if(ss[i]=="NijeZivotJedanACM"){
index=i;
continue;
}
if(s[0]=='-')
{
continue;
}
else
{
num[i]++;
ans[i]+=1200*(s[1]-'0');
ans[i]+=(s[4]-'0')*3600;
int x=s[6]-'0';
x*=10;
x+=(s[7]-'0');
ans[i]+=x*60;
x=s[9]-'0';
x*=10;
x+=(s[10]-'0');
ans[i]+=x;
}
}
num[i]=-num[i];
}
string sss;
cin>>sss;
for(int j=0; j<m; j++)
{
string s;
cin>>s;
if(s[0]=='-'||s[0]=='?')
{
continue;
}
else
{
num[index]++;
ans[index]+=1200*(s[1]-'0');
ans[index]+=(s[4]-'0')*3600;
int x=s[6]-'0';
x*=10;
x+=(s[7]-'0');
ans[index]+=x*60;
x=s[9]-'0';
x*=10;
x+=(s[10]-'0');
ans[index]+=x;
}
}
num[index]=-num[index];
int ansindex;
vector< pair< int, pair<int,string > > >v;
for(int i=0; i<n; i++){
v.pb({num[i],{ans[i],ss[i]}});
}
sort(v.begin(),v.end());
for(int i=0; i<v.size(); i++)
{
if(v[i].S.S=="NijeZivotJedanACM")
ansindex=i;
}
cout<<ansindex+1<<endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |