Блог пользователя KrK

Автор KrK, 15 лет назад, По-английски

Hello.
I submitted this code to this problem with option "GNU C++ 4.6" and received "WA on test 1".
Output was:
1
CS
while the expected answer:
2
SC
However, the program was correct in my pc (I use Dev-C++). I tried to resubmit the same code but with other option "MS C++" and it worked.
So, can somebody explain to me why this code didn't worked with "GNU C++ 4.6"?

  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

15 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

It's optimization's problem. I've Compiled your code localy with GCC 4.6 without -Ox flag, and the result is correct, but with -Ox result is wrong
15 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

By the way I could not reproduce this behavior on my local machine so you can see my submissions with debug outputs to get what I mean more clearer. Especially 599091.