When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

AshToady's blog

By AshToady, history, 2 years ago, In English

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?

  • Vote: I like it
  • -15
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it +43 Vote: I do not like it

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