Ashish's blog

By Ashish, history, 6 years ago, In English

Hey there, I tried submitting solution to 1064D during the contest. My solution can be found here. As many of you might have noticed the solution is incorrect, I was expecting WA verdict but got RTE (on pretest 8 to be precise). I tried searching a lot but could not figure out why it was RTE and not WA. The exit code was -1073741571 if it helps.Can anyone help me with the solution(Not solution to the problem but why there was a RTE verdict). Thank You

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

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

Maybe it was because your DFS used too many stack memory

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    I really think that is not the reason (Not sure though) cause 2000*2000 grid dfs should not cause the stack to overflow.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If you change #include <bits/stdc++.h>

      To

      #include <iostream>
      #include <cstring>
      #include <memory.h>
      #include <string.h>
      

      and send it on Visual C++ compiler you wouldn't have RE8.

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        It is not giving RE8. But why, can you explain little bit?

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      It does. I changed your DFS to BFS and it got WA on test 40.