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

6203번 - Serious Cow Tag 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB266897835.294%

문제

Farmer John's N (1 <= N <= 1000) cows (conveniently numbered 1..N) are going to play a game of Serious Cow Tag. In Serious Cow Tag, each cow chooses a grid point in the pasture (-7500 <= X <= 7500, -7500 <= Y <= 7500) such that the distances between all pairs of cows are unique.

The cows play in turn, starting with cow #1 and continuing with cows #2, #3, and so on (as long as the cow is still in the game). When it is a cow's turn to play, she finds the nearest cow still playing, ambles over to that cow to tag her, and then returns to her original location. As soon as a cow is tagged, she is out of the game.

The game ends when only one cow remains, and she is declared the winner.

Farmer John is taking bets with neighboring farmers as to which cow will win, so he would like to know the winner in advance. Write a program that will read a description of the cows' positions and determine the winner.

입력

  • Line 1: A single integer N, the number of cows
  • Lines 2..N+1: Line i+1 contains two space-separated integers that describe the location of cow i.

출력

  • Line 1: The number of the winning cow.

제한

예제 입력 1

3
0 0
0 3
4 3

예제 출력 1

3

힌트

Cow 1 goes first and tags the nearest cow, cow 2. Cow 2 is eliminated so she does not get a turn. Cow 3 then tags the only remaining cow, cow 1. She is the last cow left, so she wins.

출처

Olympiad > USA Computing Olympiad > 2006-2007 Season > USACO November 2006 Contest > Bronze 3번

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2002 E번

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

출처

대학교 대회

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

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