# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
508775 | ammar2000 | ACM (COCI19_acm) | C++17 | 6 ms | 332 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 ll long long
#define pb push_back
#define F first
#define S second
#define coy cout<<"YES\n"
#define con cout<<"NO\n"
#define co1 cout<<"-1\n"
#define sc(x) scanf("%lld",&x)
using namespace std;
const int SI=3e5+7;
ll INF=8e18+7;
int MOD=1e9+7;
ll n,m;
vector <pair < pair <ll,ll> ,string > >v;
int main()
{
cin>>n>>m;
for (int i=0;i<n;i++)
{
string s;
cin>>s;
ll sol,pen;
sol=pen=0;
for (int u=0;u<m;u++)
{
string h;
cin>>h;
if (h[0]=='-')
continue;
sol++;
pen+=(h[1]-'1')*60*20;
pen+=(h[4]-'0')*3600;
pen+=(h[6]-'0')*600;
pen+=(h[7]-'0')*60;
pen+=(h[9]-'0')*10;
pen+=(h[10]-'0');
}
if (s=="NijeZivotJedanACM")
continue;
v.pb({{-sol,pen},s});
}
string s;
cin>>s;
ll sol,pen;
sol=pen=0;
for (int u=0;u<m;u++)
{
string h;
cin>>h;
if (h[0]=='-')
continue;
sol++;
pen+=(h[1]-'1')*60;
pen+=(h[4]-'0')*3600;
pen+=(h[6]-'0')*600;
pen+=(h[7]-'0')*60;
pen+=(h[9]-'0')*10;
pen+=(h[10]-'0');
}
v.pb({{-sol,pen},s});
sort (v.begin(),v.end());
ll ans=0;
for (auto r:v)
{
//cout <<r.F.F<<" " <<r.F.S<<" "<<r.S<<"\n";
if (r.S=="NijeZivotJedanACM")
break;
ans++;
}
cout <<ans+1;
// use scanf not cin
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |