시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 17 | 3 | 3 | 20.000% |
Let w be a positive integer and p be a string of length 22w+1. (w, p)− cell automaton is defined as follows:
\[f(t,x) = p[\sum_{i=-w}^{w}{2^{w+i}f(t-1,x+i)}]\]
Snuke likes a cell automaton if the number of 1 doesn’t change forever (no matter how he chooses the states at time 0). You are given an integer w and a string s. Compute the lexicographically minimal p such that s ≤ p and Snuke likes (w, p)− cell automaton.
First line of the input contains one integer w (1 ≤ w ≤ 3). Next line contains string s (|s| = 22w+1, s consists of ‘0’ and ‘1’.
Print the minimal possible p. If there are no such strings, print “no” instead.
1 00011000
00011101
1 11111111
no