AshToady's blog

By AshToady, history, 6 weeks 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

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
6 weeks ago, # |
  Vote: I like it +43 Vote: I do not like it

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

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    yea, ur right..just cheked in online ide c++14..doesnt work in ++14

    ++17 seems more flexible...cooL