# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1013028 | vjudge1 | ACM (COCI19_acm) | C++17 | 3 ms | 604 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 main()
{
int n,m;
cin>>n>>m;
int ns[n]={},pen[n]={},id;
string nm[n];
for (int t=0;t<n;t++)
{
cin>>nm[t];
if (nm[t]=="NijeZivotJedanACM")
id=t;
for (int i=0;i<m;i++)
{
string s;
cin>>s;
if (s[0]!='-')
{
ns[t]++;
int sub=0,ind=0;
int fac[4]={1200,3600,60,1};
for (int j=1;j<s.size();j++)
{
if (s[j]=='/' or s[j]==':')
{
pen[t]+=sub*fac[ind];
ind++;
sub=0;
continue;
}
sub=sub*10+s[j]-'0';
}
pen[t]-=1200;
}
}
}
cin>>nm[id];
ns[id]=pen[id]=0;
for (int i=0;i<m;i++)
{
string s;
cin>>s;
if (s[0]=='+')
{
ns[id]++;
int sub=0,ind=0;
int fac[4]={1200,3600,60,1};
for (int j=1;j<s.size();j++)
{
if (s[j]=='/' or s[j]==':')
{
pen[id]+=sub*fac[ind];
ind++;
sub=0;
continue;
}
sub=sub*10+s[j]-'0';
}
pen[id]-=1200;
}
}
vector<pair<int,pair<int,string>>> teams;
for (int i=0;i<n;i++)
teams.push_back({-ns[i],{pen[i],nm[i]}});
sort(teams.begin(),teams.end());
for (int i=0;i<n;i++)
if (teams[i].second.second=="NijeZivotJedanACM")
{
cout<<i+1<<endl;
break;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |