#P2390. 地标访问
地标访问
Description
Bessie is traveling along a road with many landmarks and wants to visit as many landmarks as possible before sunset. Bessie can move one unit of distance per minute.
Treat the road as a number line. Bessie starts at the origin. There are landmarks on the road, each with a distinct coordinate . Sunset occurs after minutes.
Input Format
The first line: two integers .
The second line to line : the coordinates .
Output Format
A single integer: the maximum number of landmarks Bessie can visit.
25 14
16
8
-7
3
10
-15
-17
6
-12
14
-13
2
9
-5
8
Hint
- Bessie does not need to return to the origin at sunset.
- This differs from the original simple simulation problem.
- The testdata has been modified compared to the original problem.
Translated by ChatGPT 5
京公网安备 11011102002149号