Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Lord_vaibhav's blog

https://codeforces.me/contest/1388/problem/D of Codeforces Round #660 (Div. 2) using python

By Lord_vaibhav, history, 6 years ago, In English

I tried to solve question using topological sort from the reference https://codeforces.me/contest/1388/submission/88532119 .It passed till test 7 but gave runtime error on test 8 with exit code 1, Here's my code https://ideone.com/MK0Ra6 , please help me correct it.

Thanks in advance ☺️

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

It's stack overflow due to recursive function topsort()

See this