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

Photo Op

Diamond V 다이아몬드 V
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Farmer John's farm is full of lush vegetation and every cow wants a photo of its
natural beauty. Unfortunately, Bessie still has places to be, but she doesn't
want to disrupt any photo ops.

Bessie is currently standing at \((X,0)\) on the XY-plane and she wants to get to
\((0,Y)\) (\(1\le X,Y\le 10^6\)). Unfortunately, \(N\) (\(1 \leq N \leq 3 \cdot 10^5\))
other cows have decided to pose on the \(X\) axis. More specifically, cow \(i\) will
be positioned at \((x_i,0)\) with a photographer at \((0,y_i)\) where
\((1 \leq x_i,y_i \leq 10^6)\) ready to take their picture. They will begin posing
moments before time \(s_i\) (\(1 \leq s_i < T\)) and they will keep posing for a
very long time (they have to get their picture just right). Here,
\(1\le T\le N+1\).

Bessie knows the schedule for every cow's photo op, and she will take the
shortest Euclidean distance to get to her destination, without crossing the line
of sight from any photographer to their respective cow (her path will consist of
one or more line segments).

If Bessie leaves at time \(t\), she will avoid the line of sights for all
photographer/cow pairs that started posing at time \(s_i \le t\), and let the
distance to her final destination be \(d_t\). Determine the values of
\(\lfloor d_t\rfloor\) for each integer \(t\) from \(0\) to \(T-1\) inclusive.

Problem credits: Suhas Nagar

제약

SCORING

  • Inputs 4-6: \(N\le 100\)
  • Inputs 7-9: \(N\le 3000\)
  • Inputs 10-12: \(T\le 10\)
  • Inputs 13-18: No additional constraints

Problem credits: Suhas Nagar

입력 형식

The first line of input contains \(N\) and \(T\), representing the number of cows
posing on the \(x\)-axis and the timeframe that Bessie could leave at.

The second line of input contains \(X\) and \(Y\), representing Bessie's starting \(X\)
coordinate and her target \(Y\) coordinate respectively.

The next \(N\) lines contain \(s_i\) \(x_i\) and \(y_i\). It is guaranteed that all
\(x_i\) are distinct from each other and \(X\), and all \(y_i\) are distinct from each
other and \(Y\). All \(s_i\) will be given in increasing order, where
\(s_i \leq s_{i+1}\).

출력 형식

Print \(T\) lines, with the \(t\)th (0-indexed) line containing
\(\lfloor d_t\rfloor\).

예제 1
입력
4 5
6 7
1 7 5
2 4 4
3 1 6
4 2 9
출력
9
9
9
10
12
예제 2
입력
2 3
10 7
1 2 10
1 9 1
출력
12
16
16
설명

For \(t=0\) the answer is \(\lfloor \sqrt{149} \rfloor=12\).

For \(t=1\) the answer is \(\lfloor 14+\sqrt 5\rfloor=16\).

예제 3
입력
5 6
8 9
1 3 5
1 4 1
3 10 7
4 9 2
5 6 6
출력
12
12
12
12
14
14
설명

For \(t=5\) the answer is \(\lfloor 1+\sqrt{9^2+7^2}+2\rfloor=14\). Path:
\((8,0)\to (9,0)\to (0,7)\to (0,9)\)

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2024-2025 > January > Gold

태그

평가 및 의견

Photo Op

개요
출제자 난이도 Diamond V 다이아몬드 V 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Photo Op

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