Please read the new rule regarding the restriction on the use of AI tools. ×

mjnovice's blog

By mjnovice, 10 years ago, In English

I was trying to solve FIRESC using http://www.codechef.com/viewsolution/3708062. Have used dfs implemented using stack in python and sys.stdin.readlines(). Yet, it is slow. Can someone suggest me if there is a faster way ? as here N=10^5, and it becomes slow for that.

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

»
10 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Do not use python to solve algorithmic problems )

When constraints are about 10^5, it is always slow and you can easily get TL =(