Logo
(追記) (追記ここまで)

26250번 - Guess Table 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB225525.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.

제한

예제 입력 1

2 3
1
1
1
0

예제 출력 1

Query: 2 1
0
0
Query: 1 2
01
Query: 2 2
01
0?
Query: 2 3
101
??0
Answer:
101
001

힌트

출처

Contest > Open Cup > 2016/2017 Season > Stage 7: Grand Prix of Dolgoprudny E번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /