Jubayer_Joy's blog

By Jubayer_Joy, history, 10 days ago, In English,

CF Wrong Judgement on #483(div 2) Problem B.Minesweeper

On Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Shaburov!] I got wrong answer in testcase#13 on Problem B. I literary stopped sleeping to figure out what went wrong, but as full testcase is not shown, I couldn't get any clue.

but, when I again submitted the same code today, It was accepted.

In Contest submission link: 38291441 After Contest submission : 38328663

KAN, Livace, neckbosov please look into it and kindly make adjustment to my rating if possible.

MikeMirzayanov please look into the system what caused the malfunction.

If possible anyone please explain why this happened.

Thank you.

 
 
 
 

»
10 days ago, # |
  Vote: I like it +5 Vote: I do not like it

i just copied your code and submitted

WA at 12 LOL

»
10 days ago, # |
  Vote: I like it +25 Vote: I do not like it

in your code you check a[i-1][j]

where i can be 0 which means i-1 can be -1

that will cause weird thing (it usually cause runtime error on my experience

  • »
    »
    10 days ago, # ^ |
      Vote: I like it -16 Vote: I do not like it

    Yeah, But I saw some solution just like mine which were accepted. I think it should have caused problem in earlier testcase.

    It's pretty weird. C++17 may be more optimised in regard to this issue.

    Thanks for Checking it.

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I am not sure but it might be due to the fact that in your loops you use i-1,i+1,j-1 and j+1 which may cause overflow when i=0,i=r-1,j=0 and j=c-1 respectively. So it depends on what the random character is begin taken us.

  • »
    »
    10 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same system giving Different output, I don't get how :-(

    same c++17 compilier same Judgement criteria same system and testcase

    But my conditions should have wipped out random characters unless it was '*'. Thank you for explaining.

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

You code has undefined behaviour, in "for" you refer to -1 element of array.

  • »
    »
    10 days ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    please explain why it is accepted after contest?

    • »
      »
      »
      10 days ago, # ^ |
        Vote: I like it +8 Vote: I do not like it

      Undefined behaviour means variable results Next time, you should skip undefined elements, for safety