Блог пользователя AshToady

Автор AshToady, история, 3 года назад, По-английски

solution with settings=c++14 solution with settings=c++17 I have never used gnu c++17 as my setting, always c++14. But what actually happened was, in my ide, visual studio, test case-2 gave correct output=13...but on codeforces results of the test was showing output=11 wrong ans. i thought this is some codeforces glitch, i changed the code variables a bit to be able to submit the same code again. But nothing changed. Then i randomly thought of changing lang to c++ 17...and it gave all correct outputs->accepted i.e.

I dont what i should do...its been an year, never used c++17 settings... why did this happen today?

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +43 Проголосовать: не нравится

Undefined behavior regarding the use of i++ in the for loop increment