| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 22 | 5 | 5 | 25.000% |
Jury has created a $n \times m$ matrix $A$ consisting of zeroes and ones. You should guess it.
In order to do that you can send no more than 200ドル$ queries. At the end you should print the desired matrix.
Each query is described by the matrix $B$ of size $a\times b$ (1ドル\le a\le n, 1\le b\le m$) consisting of zeroes, ones and questions. The answer to the query is 1ドル$ if the matrix $A$ contains continuous submatrix that corresponds to the given pattern $B$. Otherwise the answer will be equal to 0ドル$.
Formally the answer will be equal to 1ドル$ if and only if exists some values $(i, j)$ (1ドル \le i \le n-a+1, 1 \le j \le m-b+1$), so for each $(x, y)$ (1ドル\le x\le a, 1\le y\le b$) $B_{xy}$ is a question or $B_{xy}=A_{i+x-1, j+y-1}$.
Also there is another restriction for the query matrix $B$: there should be no row and no column fully consisting of questions.
Note the problem is interactive, so you should flush your output after each query and at the end of the guess. To do that use function fflush(stdout) in C++ language and PrintWriter.flush() in Java language.
On the first line of each your query print a string "Query:" (without quotes) and two integers $a, b$ (1ドル \le a\le n, 1\le b \le m$) --- the size of the submatrix. After that print $a$ lines with $b$ symbols "0", "1" and "?". Don't forget to flush you output after that.
After each query you will get an answer --- a single line with number 1ドル$ if the desired matrix contains given submatrix and 0ドル$ otherwise.
You are given two integers $n$ and $m$ (1ドル \le n,m \le 13$) --- the size of the matrix to guess.
At the end you should print a line with a string "Answer:" (without quotes) on the first line. After that print $n$ lines with $m$ symbols "0" and "1" --- the desired matrix. Don't forget to flush you output after that.
2 3 1 1 1 0
Query: 2 1 0 0 Query: 1 2 01 Query: 2 2 01 0? Query: 2 3 101 ??0 Answer: 101 001