Sreedhar3210's blog

By Sreedhar3210, 3 months ago, In English

I was solving this problem 2003D2 - Turtle and a MEX Problem (Hard Version).

I have made two submissions on that Accepted on G++17 278425043, Runtime error on G++20 278423515.

The code on both of the submissions is the same, but i do not know why this code isn't being accepted on G++20.

Even surprisingly when i removed comments from the above submission it is giving TLE verdict.

Accepted on G++17 278459735, TLE on G++20 278459715.

Can anyone explain this strange behaviour?

Tags gcc, c++
  • Vote: I like it
  • +1
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it +9 Vote: I do not like it

I am not sure, but maybe it is because you don't return anything from DFS. It has long long type and in many other languages (to be honest, as I know all languages except C and C++) you will get RE. But sometimes it can occur in C and C++, so maybe it is the case.

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yes, the issue seems to be because of that unhandled return type.

    but it is also giving TLE, when i remove the comments.