Getting Weird RE (AtCoder Online Judge)

Правка en8, от vok8, 2020-05-25 20:02:21
  • 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 in Submission-2 and commented in Submission-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 pragmas and the reasons, which might lead to RE. Hence, I gotta know that "O3" and "Ofast" (O1 + O2 + O3) contain some optimisations, which clash with target("avx2"), which both try to optimise the loops at the same time in a different manner, hence leading to RE. Hence, I think, using O2 + 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 ;).
Теги #atcoder, #runtime, #weird, #error

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en14 Английский vok8 2020-05-27 18:18:51 1 Tiny change: '` solution' -> '` solution.'
en13 Английский vok8 2020-05-27 18:18:39 1 Tiny change: '` solution.' -> '` solution'
en12 Английский vok8 2020-05-26 10:29:08 59
en11 Английский vok8 2020-05-26 10:27:38 162
en10 Английский vok8 2020-05-26 09:19:43 522
en9 Английский vok8 2020-05-25 20:03:39 7 Tiny change: '"O3"` and `"Ofast" ' -> '"O3"` and hence, `"Ofast" '
en8 Английский vok8 2020-05-25 20:02:21 39
en7 Английский vok8 2020-05-25 20:00:54 7 Tiny change: ' you!\n\n- **UP' -> ' you!\n\n---\n\n- **UP'
en6 Английский vok8 2020-05-25 19:59:26 73
en5 Английский vok8 2020-05-25 19:57:48 396
en4 Английский vok8 2020-05-25 17:34:13 6
en3 Английский vok8 2020-05-25 17:05:20 51
en2 Английский vok8 2020-05-25 17:00:50 5
en1 Английский vok8 2020-05-25 16:59:56 917 Initial revision (published)