|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|3 초||512 MB||1||1||1||100.000%|
Ann is decorating her office with the coolest arrangement of lights ever. She is using very long LED strips, where each individual cell is switched on or off every second, according to the following simple and pretty algorithm. At each step, the status of each cell (0 for off and 1 for on) is determined from the status of its two neighbor cells on the strip (left and right) and its own status, according to the following table:
|New state for center cell||0||1||1||0||1||1||1||0|
Ann is choosing an initial configuration for the cells and she marvels at the resulting animation, which happens to be highly similar to Conway's Game of Life, with interesting behavior on the boundary between stability and chaos.
The input is composed of two lines.
1. All the cells to the left and to the right of this string are considered to be 0.
The output should contain a single line with a single integer that is the total number of 1-cells in the final configuration.
the output is $11$ since we have the following five steps:
...0000000010011011111000... ...0000000110111110001000... ...0000001111100010011000... ...0000011000100110111000... ...0000111001101111101000... ...0001101011111000111000...
where everything not displayed contains only 0-cells.