variance's blog

By variance, history, 2 years ago, In English

Consider submissions 151556965 and 151558044. They are the same, except that the first is in C++20 and the second is C++17. The solutions fail because the bounds for the problem are N <= 2e5, but I used MAXN = 20005 for the length of an array (the problem involved reading in an array of length N).

Thus we get RTE on the C++17 submission (as expected) due to accessing memory out-of-bounds. But why does the first one TLE?

Full text and comments »

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