Problem: XXOR
Submission-1: Link (Runtime Error)
Submission-2: Link (Accepted)
The difference between both the submissions is just the two
cout<<"";statements, in the two "n" range for loops.The
cout<<"";statements are uncommented inSubmission-2and commented inSubmission-1. And guess what, these statements convert a RE Submission to an AC Submission.The code in Submission-1, for a Valid Random Input, runs finely in Codeforces' Custom Test, whereas it gives RE in AtCoder's Custom Invocation. (You may try, for more clarification and to find the reason!)
I found it weird! I am totally clueless about why this is happening. Can anyone please justify or explain, why is this happening?
Thank you!
- UPD-1: I surfed about
pragmasand the reasons, which might lead to RE. Hence, I gotta know that"O3"and"Ofast" (O1 + O2 + O3)contain some optimisations, which clash withtarget("avx2"), which both try to optimise the loops, hence leading toRE. Hence, I think, usingO2 + target("avx2"), won't lead to RE or any other error, and will optimise the code, to the required extent. But, still wondering, why and how it worked on CF Custom Test ;).



