C++14 giving verdict TLE instead of RE

Revision en1, by c2h5sh, 2020-08-07 21:35:08

Running this code locally gives Runtime Error on test 3 due to this:

s.erase(s.find(cnt));

Which I replaced by this:

auto itr = s.find(cnt);
    if (itr != s.end())
        s.erase(itr);

And it passed all test.

It took me less than a minute to figure out that deletion might be causing RE.

But during the contest, I spent more than an hour thinking about why it was giving TLE.

Is this normal behaviour on Codeforces compilers or is it a bug. If it's normal, then how do we deal with such verdicts (a TLE which actually is just a RE)?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English c2h5sh 2020-08-07 21:35:08 686 Initial revision (published)