아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Confined Catching

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

요약
n x n 격자에서 두 개의 말로 인공지능의 말 하나를 추격하는 대화형 게임으로, 600턴 안에 같은 칸에 도달해 잡아야 한다.
난이도

보통10점 중 7점

유형
그리디, 시뮬레이션, 구현, 게임 이론
정답자
아직 제출이 없습니다

문제

You are playing a board game against an AI on a square grid consisting of n×nn\times n cells. You have two game pieces and the AI has one, and each piece is placed in one of the grid cells. Your goal is to "catch" the AI's piece, that is, one (or both) of your pieces has to lie in the same cell as the AI's piece after one of your turns. When this happens, you win and the game ends. You lose if you have not won after 600 turns.

Each turn, you have up to five movement options per piece: You can move a piece up, down, left, or right to an adjacent cell (if there is one) or let the piece remain in its current cell. The AI has the same options for its piece in each of its turns. Of course, you can move your pieces completely independently from one another and even have them occupy the same cell.

Your goal is simple: Win the game! You can safely assume that this is always possible.

입력

Before it is your first turn, your program will receive:

  • One line with an integer nn (3≤n≤1003 \le n \le 100), giving the size of the grid.
  • One line with four integers x_1,y_1,x_2,y_2x\_1,y\_1,x\_2,y\_2 (1≤x_1,y_1,x_2,y_2≤n1 \le x\_1,y\_1,x\_2,y\_2 \le n), giving your pieces' initial positions.
  • One line with two integers x,yx,y (1≤x,y≤n1 \le x,y \le n), giving the AI's piece's initial position.

You can safely assume that your pieces do not lie in the same cell as the AI's piece (but they may lie in the same cell as each other).

예제1

  1. 예제 1

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