Treasure Hunt

시간 제한1초메모리 제한2048 MB

요약
5x5 격자에 숨은 2x2 보물 상자의 왼쪽 위 좌표를 셀 질의 5회 이내로 알아낸다.
난이도

보통10점 중 6점

유형
이분 탐색, 구현, 수학
정답자
아직 제출이 없습니다

문제

There is a 2×22 \times 2 box of treasure hidden somewhere in a 5×55 \times 5 grid. The rows are numbered from 11 to 55, as are the columns, with cell (1,1)(1,1) being the top left corner of the grid. Your goal is to find the treasure within 55 queries. You can query a grid cell and ask if there is any part of the treasure chest in that grid cell. After at most 55 queries, you must output the upper left coordinate of the treasure box.

예제1

  1. 예제 1

    입력
    
    0
    
    1
    
    0
    
    1
    
    
    예상 출력
    ? 3 3
    
    ? 2 2
    
    ? 1 1
    
    ? 1 3
    
    ! 1 2