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

S5. Lazy Fox

설명

You have a pet Fox who loves treats. You have \(N\) neighbours at distinct locations
(described as points on the Cartesian plane) which hand out treats to
your pet Fox, and each neighbour has an unlimited number of treats to
give out. The origin (which is where the Fox starts) will not be one of
these \(N\) locations.

What does the Fox say, in order to get these treats? That is a good
question, but not our concern.

The Fox moves from location to location to gather exactly one treat
from each location on each visit. He can revisit any previous location,
but cannot visit the same location on two
consecutive visits.

Your Fox is very lazy. The distance your Fox is willing to travel
after each treat will strictly decrease. Specifically, the distance from
the origin to his first treat location must be larger than the distance
from his first treat location to his second treat location, which in
turn is larger than the distance between his second treat location and
his third treat location, and so on.

What is the largest number of treats your Fox gathers?

제약
입력 형식

The first line contains the integer \(N~(1 \leq N \leq 2000)\). The next \(N\)
lines each contain \(X_i\), followed by
a space, followed by \(Y_i\), for \(i=1..N~(-10\ 000 \leq X_i, Y_i \leq 10\ 000)\) representing the coordinates of
the \(i\)th location. The following
additional constraints will apply.

  • At least 20% of the marks will be for test cases where \(N \leq 50\);

  • at least 40% of the marks will be for test cases where \(N \leq 200\);

  • the remaining marks will be for test cases where \(N \leq 2000\).

출력 형식

The output is one integer, the largest number of treats your Fox can
gather.

예제 1
입력
5
5 8
4 10
3 1
3 2
3 3
출력
6
설명

The Fox performs the visits in the following order (with the
indicated distances):

  • \((0,0)\) to \((4, 10)\) with distance \(\sqrt{116}\);

  • \((4,10)\) to \((3,1)\) with distance \(\sqrt{82}\);

  • \((3,1)\) to \((5,8)\) with distance \(\sqrt{53}\);

  • \((5,8)\) to \((3,3)\) with distance \(\sqrt{29}\);

  • \((3,3)\) to \((3,1)\) with distance \(2\);

  • \((3,1)\) to \((3,2)\) with distance \(1\).

문제 정보

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

출처 CCC 2014 Senior

평가 및 의견

S5. Lazy Fox

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

Log in to rate problems.

개별 의견

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

풀이 제출

S5. Lazy Fox

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