Weirdest TLE — CSES (Grid Paths)

Правка en1, от Blaz, 2021-10-25 00:36:36

Hello,

With some friends we are very confused because of this. We have these two different codes:

The weird thing is that they are the same code, but the ONLY difference is how we read the input to the global string "path".

On the AC code:

string sAux; // line 69
cin >> sAux;
 
path = sAux;

On the TLE code:

cin >> path; // line 69

The submission that gives TLE reads directly into the global variable, while the AC code reads into an intermediary local string and then assigns to the global variable.

We have absolutely no idea why or how this makes any difference.

Any ideas? Thanks!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Blaz 2021-10-25 00:36:36 817 Initial revision (published)