RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00009

I. Mummy Madness

Unrated 레이팅 미적용
난이도
3s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

During an excursion to the desert at the 2011 A\(CM-IC\)PC World Finals, you come across an old Egyptian tomb. Unfortunately, opening the tomb turns out to be a bad idea: all of a sudden, what was just a few moments ago an empty desert has now become a desert crawling with grumpy mummies (you would be grumpy too if you were suddenly awakened after a few thousand years of peaceful sleep).^{2} Faced with this murderous mass of mad mummies, your only chance is to run for it and try to escape before they catch you. The question is: how long will it take before a mummy catches you, assuming neither you nor the mummies ever get tired? We model the desert as a grid of squares. You and the mummies take turns making moves on the grid. You make the first move. In your turns, you can move to any of the eight squares adjacent to your current location, or you can choose to stand still. In the mummies’ turns, each mummy simply moves to the adjacent square that brings it closest to you (measured by Euclidean distance, assuming that you and all the mummies stand in the centers of their respective squares). It is possible for two mummies to occupy the same square. A time step consists of your move followed by the mummies’ moves. A mummy catches you if it moves to the square where you are located, or if you move to the square occupied by the mummy. Of course, you try to avoid being caught for as long as possible. After how many time steps will you be caught? Figure I.1: A mummy chase The figure illustrates what might happen if you are being chased by four mummies. The square labeled H is your initial position, and the squares labeled M are the initial positions of mummies. After four time steps, you are caught by the mummy whose initial position was (3, 4) with respect to your initial position. ^{2}Fortunately, after solving this problem, you woke up safe and sound in a hotel room in Florida. The enraged mummies had just been a dream. Or had they?

제약
입력 형식

The input consists of several test cases. Each test case begins with an integer \(n\) (\(0 \le n \le 10^{5}\)) giving the number of mummies in the desert. The following \(n\) lines each contain two integers \(x\) and \(y\), indicating that there is initially a mummy at coordinates (x, y) of the desert, where \(x\) and \(y\) are both bounded by \(10^{6}\) in absolute value. Your starting position is (0, 0), and no mummy starts at this position. The last test case is followed by a line containing the numb\(er - 1\).

출력 형식

For each test case, display its test case number followed by the maximum number of time steps until you are caught (measured as the total number of turns that you get), or the word “never” if you can avoid capture indefinitely. Follow the format of the sample output.

예제 1
입력
4
-3 5
3 4
-6 -2
1 -5
1
0 -1
-1
ICPC 2011 World Finals Problem I: Mummy Madness
출력
Case 1: 4
Case 2: never
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2011

평가 및 의견

I. Mummy Madness

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

I. Mummy Madness

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8