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

34289번 - Blaster the Daredevil 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
7 초 2048 MB20141470.000%

문제

This year, Blaster wants to make a grand exit from graduation, and what better way to do so than by launching himself out of a cannon? Blaster's stunt can be modeled as a path in the XY-plane where the cannon is positioned at the origin, $(0, 0),ドル and can be aimed at any angle.

Suspended in the air are $n$ floating hoops, each represented as a vertical segment. The $i$-th hoop is located $x_i$ meters along the X-axis. The bottom of the hoop is positioned $a_i$ meters above the X-axis, and the top of the hoop is positioned $b_i$ meters above the X-axis.

Blaster, modeled as a single point, will follow a perfectly straight-line trajectory after launch (since he has conveniently disabled Earth's gravity for this stunt). He is considered to pass through a hoop if his trajectory intersects or touches at least one point on the vertical line segment between $(x_i, a_i)$ and $(x_i, b_i)$.

Your task is to determine the maximum number of hoops Blaster can pass through if you carefully choose the cannon's launch angle.

입력

The first line contains a single integer $n$ $(1 \leq n \leq 10^5)$ — the number of hoops.

Each of the next $n$ lines contains three integers $x_i, a_i, b_i$ $(1 \leq x_i \leq 10^9, 0 \leq a_i \leq b_i \leq 10^9),ドル describing the position and height range of the $i$-th hoop.

It is guaranteed that perturbing the endpoints of hoops up or down by at most 10ドル^{-6}$ meters will not affect the answer.

출력

Print a single integer---the maximum number of hoops Blaster can pass through for an optimal choice of launch angle.

제한

예제 입력 1

5
2 1 3
4 2 5
3 1 4
5 3 6
1 2 3

예제 출력 1

4

힌트

출처

School > CS@Mines > CS@Mines HSPC 2025 I번

  • 문제를 만든 사람: Kelly Dance
(追記) (追記ここまで)

출처

대학교 대회

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

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