Runtime error
Difference between en1 and en2, changed 20 character(s)
recently in codeforces round 565 i face an unusual problem of runtime error.↵
please anyone explain me why the judge at codeforces threw runtime error while my terminal or any other ide was giving right answer to the test cases.↵



ques-https://codeforces.com/contest/1176/problem/C↵
code-


code-↵




int main()↵
{↵
ll i,j,t,n,a,b,c,d,e,f;↵
cin>>n;↵
if(n==0)↵
{↵
cout<<"0";↵
return 0;↵
}↵
map<ll,vector<ll> >m;↵
ll count=0;↵
ll arr[n];↵
f(i,0,n)↵
cin>>arr[i];↵
m[4] = {};↵
m[8] = {};↵
m[15] = {};↵
m[16] = {};↵
m[23] = {};↵
m[42] = {};↵
for(i=n-1;i>=0;i--)↵
m[arr[i]].push_back(i);↵


a=m[4].size()-1;↵
b=m[8].size()-1;↵
c=m[15].size()-1;↵
d=m[16].size()-1;↵
e=m[23].size()-1;↵
f=m[42].size()-1;↵
//cout<<a<<b<<c<<d<<e<<f<<"\n";↵
while(a>=0 && b>=0 && c>=0 && d>=0 && e>=0 && f>=0 )↵
{↵
//cout<<"in\n";↵
if(m[4][a]<m[8][b])↵
{↵
if(m[8][b]<m[15][c])↵
{↵
if(m[15][c]<m[16][d])↵
{↵
if(m[16][d]<m[23][e])↵
{↵
if(m[23][e]<m[42][f])↵
{↵
count++;↵
a-=1;↵
b-=1;↵
c-=1;↵
d-=1;↵
e-=1;↵
f-=1;↵
}↵
else↵
f-=1;↵
}↵
else↵
e-=1;↵
}↵
else↵
d-=1;↵
}↵
else↵
c-=1; ↵
}↵
else↵
b-=1;↵
}↵
n=n-count*6;↵
cout<<n;↵
return 0;↵
}

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English anucool1325 2019-06-24 09:09:12 1078
en2 English anucool1325 2019-06-18 04:40:57 20
en1 English anucool1325 2019-06-18 04:40:00 1359 Initial revision (published)