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

5959번 - Crop Circles 다국어

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

문제

Bessie and her fellow herd-mates have become extremely territorial. The N (1 <= N <= 400) cows conveniently numbered 1..N have all staked out a grazing spot in the pasture. Each cow i has a spot on an integer grid (0 <= X_i <= 10,000; 0 <= Y_i <= 10,000) and an integer radius R_i that indicates the circle she is staking out (1 <= R_i <= 500).

The cows are a bit greedy and sometimes stake out territory of their herd-mates. For each cow, calculate the number of other cows whose territory overlaps her territory.

By way of example, consider these six cows with indicated locations and radii (don't confuse radius with diameter!):

By visual inspection, we can see and count the overlaps, as shown.

NOTE: the test data will avoid pathological situations like tangents where the circles just barely touch.

입력

  • Line 1: A single integer: N
  • Lines 2..N+1: Three space-separated integers: X_i, Y_i, and R_i

출력

  • Lines 1..N: Line i contains a single integer that is the number of other fields that overlap with cow i's field.

제한

예제 입력 1

6
7 7 7
16 14 7
11 13 2
10 17 3
29 8 5
15 7 4

예제 출력 1

3
4
3
2
0
2

힌트

출처

Olympiad > USA Computing Olympiad > 2010-2011 Season > USACO January 2011 Contest > Bronze 4번

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

출처

대학교 대회

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

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