JaberSH1's blog

By JaberSH1, history, 8 months ago, In English

The same solution was submitted in both C++17 (GCC 7-32) & C++20 (GCC 13-64).

AC submission passed with 0 KB on C++17 (GCC 7-32): 257826303

While it resulted in an MLE on C++20 (GCC 13-64): 257826268

The code uses linear memory and it failed on the 8th test which is only of size 10 :/

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

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by JaberSH1 (previous revision, new revision, compare).

»
8 months ago, # |
  Vote: I like it -7 Vote: I do not like it

Too much uncling the compiler got confused

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

17 is your uncle

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

There is a chance that there is some undefined behavior in the code, but I definitely won't read all of that...

»
8 months ago, # |
  Vote: I like it +15 Vote: I do not like it

You read uninitialized values from sz so your behaviour is undefined.

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

    Damn, that's true, sorry for wasting your time :/