Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
A traveler is planning a water hike along the river. He noted the suitable rest points for the night and wrote out their distances from the starting point. Each of these locations is further characterized by its picturesqueness , so for the i -th rest point the distance from the start equals x i , and its picturesqueness equals b i . The traveler will move down the river in one direction, we can assume that he will start from point 0 on the coordinate axis and rest points are points with coordinates x i . Every day the traveler wants to cover the distance l . In practice, it turns out that this is not always possible, because he needs to end each day at one of the resting points. In addition, the traveler is choosing between two desires: cover distance l every day and visit the most picturesque places. Let's assume that if the traveler covers distance r j in a day, then he feels frustration , and his total frustration over the hike is calculated as the total frustration on all days. Help him plan the route so as to minimize the relative total frustration : the total frustration divided by the total picturesqueness of all the rest points he used. The traveler's path must end in the farthest rest point. The first line of the input contains integers n , l ( 1 ≤ n ≤ 1000, 1 ≤ l ≤ 10 5 ) — the number of rest points and the optimal length of one day path. Then n lines follow, each line describes one rest point as a pair of integers x i , b i ( 1 ≤ x i , b i ≤ 10 6 ). No two rest points have the same x i , the lines are given in the order of strictly increasing x i . Print the traveler's path as a sequence of the numbers of the resting points he used in the order he used them. Number the points from 1 to n in the order of increasing x i . The last printed number must be equal to n . In the sample test the minimum value of relative total frustration approximately equals 0.097549. This value can be calculated as . |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
40378772 |
eriksuenderhauf |
E |
July 15, 2018, 12:42 p.m. |
OK |
GNU C++11 |
TESTS |
68 |
62 |
8192000 |
|
2700 |
|
49636782 |
anjn98 |
E |
Feb. 8, 2019, 7:08 p.m. |
OK |
GNU C++11 |
TESTS |
68 |
78 |
102400 |
|
2700 |
|
57929668 |
luogu_bot1 |
E |
July 29, 2019, 8:18 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
139 |
102400 |
|
2700 |
|
44490471 |
luogu_bot1 |
E |
Oct. 18, 2018, 2:16 p.m. |
OK |
GNU C++11 |
TESTS |
68 |
140 |
102400 |
|
2700 |
|
49492781 |
alex_Harry |
E |
Feb. 5, 2019, 11:02 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
156 |
0 |
|
2700 |
|
62251234 |
Llf0703 |
E |
Oct. 10, 2019, 9:20 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
171 |
0 |
|
2700 |
|
58116608 |
luogu_bot3 |
E |
Aug. 1, 2019, 9:04 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
171 |
2764800 |
|
2700 |
|
58116526 |
luogu_bot1 |
E |
Aug. 1, 2019, 9:03 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
171 |
2764800 |
|
2700 |
|
58158228 |
luogu_bot2 |
E |
Aug. 2, 2019, 6:30 a.m. |
OK |
GNU C++11 |
TESTS |
68 |
202 |
409600 |
|
2700 |
|
42781965 |
Xi_Jinping |
E |
Sept. 11, 2018, 10:21 p.m. |
OK |
GNU C++11 |
TESTS |
68 |
217 |
24064000 |
|
2700 |
|
40987644 |
ReaLNero1 |
E |
July 30, 2018, 9:23 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
46 |
0 |
|
2700 |
|
42223504 |
sggutier |
E |
Aug. 28, 2018, 11:48 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
62 |
8089600 |
|
2700 |
|
67897077 |
mota_haathi |
E |
Dec. 29, 2019, 2:38 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
109 |
0 |
|
2700 |
|
65638707 |
thanhtam1821 |
E |
Nov. 24, 2019, 8:49 a.m. |
OK |
GNU C++14 |
TESTS |
68 |
109 |
0 |
|
2700 |
|
54560239 |
coder_rk98 |
E |
May 24, 2019, 1:36 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
124 |
0 |
|
2700 |
|
56504653 |
megatron10599 |
E |
July 4, 2019, 7:56 a.m. |
OK |
GNU C++14 |
TESTS |
68 |
139 |
0 |
|
2700 |
|
53375062 |
bhargav_0085 |
E |
April 26, 2019, 7:20 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
139 |
0 |
|
2700 |
|
53375044 |
bhargav_0085 |
E |
April 26, 2019, 7:19 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
140 |
0 |
|
2700 |
|
51604507 |
KATATONIA |
E |
March 21, 2019, 6:37 a.m. |
OK |
GNU C++14 |
TESTS |
68 |
218 |
204800 |
|
2700 |
|
59816518 |
ayk16 |
E |
Aug. 31, 2019, 3:32 p.m. |
OK |
GNU C++14 |
TESTS |
68 |
234 |
307200 |
|
2700 |
|
63541515 |
hjk1030 |
E |
Oct. 27, 2019, 9:29 a.m. |
OK |
GNU C++17 |
TESTS |
68 |
93 |
0 |
|
2700 |
|
47525415 |
lohit_97 |
E |
Dec. 26, 2018, 3:34 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
93 |
0 |
|
2700 |
|
58853953 |
aZvezda |
E |
Aug. 15, 2019, 8:33 a.m. |
OK |
GNU C++17 |
TESTS |
68 |
124 |
102400 |
|
2700 |
|
65578546 |
tpaaaa |
E |
Nov. 23, 2019, 10:15 a.m. |
OK |
GNU C++17 |
TESTS |
68 |
156 |
2048000 |
|
2700 |
|
42740242 |
majk |
E |
Sept. 10, 2018, 3:51 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
186 |
0 |
|
2700 |
|
39653893 |
cai_lw |
E |
June 25, 2018, 3:39 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
187 |
0 |
|
2700 |
|
62168631 |
Umi |
E |
Oct. 8, 2019, 10:18 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
217 |
0 |
|
2700 |
|
69378034 |
limabeans |
E |
Jan. 22, 2020, 6:44 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
218 |
0 |
|
2700 |
|
61608774 |
ruo |
E |
Oct. 1, 2019, 1:30 p.m. |
OK |
GNU C++17 |
TESTS |
68 |
233 |
0 |
|
2700 |
|
59975997 |
Skybytskyi.Nikita |
E |
Sept. 4, 2019, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
68 |
234 |
0 |
|
2700 |
|
58939461 |
dodoBehind |
E |
Aug. 17, 2019, 6:16 a.m. |
OK |
Java 8 |
TESTS |
68 |
187 |
0 |
|
2700 |
|
58644430 |
dodoBehind |
E |
Aug. 12, 2019, 5:13 a.m. |
OK |
Java 8 |
TESTS |
68 |
202 |
0 |
|
2700 |
|
41432838 |
amnesiac_dusk |
E |
Aug. 10, 2018, 1:28 p.m. |
OK |
Java 8 |
TESTS |
68 |
405 |
4608000 |
|
2700 |
|
58639790 |
dodoBehind |
E |
Aug. 12, 2019, 2:44 a.m. |
OK |
Java 8 |
TESTS |
68 |
452 |
0 |
|
2700 |
|
58643892 |
dodoBehind |
E |
Aug. 12, 2019, 5 a.m. |
OK |
Java 8 |
TESTS |
68 |
499 |
0 |
|
2700 |
|
59824770 |
Hadjar |
E |
Aug. 31, 2019, 6:56 p.m. |
OK |
Kotlin |
TESTS |
68 |
467 |
0 |
|
2700 |
remove filters
Back to search problems