Having problem to understand the problem (lights Out - Codeforces)

Here is the problem is known as Lights Out.

According to the problem, if I click any place(x) then the up, down, left and the right side will toggle with the corresponding x.( if it’s on then it will off and vice versa )
This game is a better representation of what this problem saying.

But if we look at the first example then it is,
Input:

100
000
001

And output,

001
010
100

But why the output is like that? I’m expecting,

010
101
010

Please let me know, where I’m making the mistake :heart:

I was also confused by the problem. So, I looked at someone’s submission, and saw the extra test ouputs, and think I understand it:

  • All the lights start off as on(silly sentence) start as being in the ON state:
111
111
111
  • You are given an input indicating the number of times a certain switch has been toggled:
100
000
001
  • Adjacent (this apparently includes diagonal) lights are affected by toggles
111 => 001
111 => 010
111 => 100

I hope this helps somewhat

1 Like

@Sky020 Thank you so much! :heart: It does make sense now.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.