This question doesn't support checking answers.
707. Lights Out

Publish Date:

Consider a w×h grid. A cell is either ON or OFF. When a cell is selected, that cell and all cells connected to that cell by an edge are toggled on-off, off-on. See the diagram for the 3 cases of selecting a corner cell, an edge cell or central cell in a grid that has all cells on (white).

LightsOut

The goal is to get every cell to be off simultaneously. This is not possible for all starting states. A state is solvable if, by a process of selecting cells, the goal can be achieved.

Let F(w,h) be the number of solvable states for a w×h grid. You are given F(1,2)=2, F(3,3)=512, F(4,4)=4096 and F(7,11)270016253(mod1000000007).

Let f1=f2=1 and fn=fn1+fn2,n3 be the Fibonacci sequence and define S(w,n)=k=1nF(w,fk) You are given S(3,3)=32, S(4,5)=1052960 and S(5,7)346547294(mod1000000007).

Find S(199,199). Give your answer modulo 1000000007.

Press F12 and use the "Console" tab to view the output of your codes.

Loading...