Mysterous output from MS C++ 2017 compiler
Difference between en1 and en2, changed 88 character(s)
I'm solving [this problem (2A)](https://mirror.codeforces.com/contest/2/problem/A).↵
After some local tests, I submitted the code using the "MSC++ 2017" compiler(MSVC), as I initially wrote my code in Visual Studio 2022.↵
However, although the "MSC++ 2022" compiler in VS successfully generated the correct answer for test case 1, [my code
 got the wrong answer on test 1](https://mirror.codeforces.com/contest/2/submission/199350619) got the wrong answer on test 1, with, with, even, an opposite answer.output!
Furthermore, when I switch
ed to other compilers like "GNU G++ 20" or even "[Clang++17 diagnostics](https://mirror.codeforces.com/contest/2/submission/199350641)", my code was accepted.↵

So, what happened exactly? Are there some hidden undefined behaviours in my code? Or is it have some bugs in this version of the MSVC compiler that CodeForces currently using?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English tatianyi 2023-03-27 05:12:55 88 (published)
en1 English tatianyi 2023-03-27 05:09:24 838 Initial revision (saved to drafts)