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
B"You are given N points on an infinite plane with the Cartesian coordinate system on it. N-1 points lay on one line, and one point isn't on that line. You are on point K at the start, and the goal is to visit every point. You can move between any two points in a straight line, and you can revisit points. What is the minimum length of the path? The first line contains two integers: N ( 3 <= q N <= q 2*10^5 ) - the number of points, and K ( 1 <= q K <= q N ) - the index of the starting point. Each of the next N lines contain two integers, A_i , B_i ( -10^6 <= q A_i, B_i <= q 10^6 ) - coordinates of the i-th point. The output contains one number - the shortest path to visit all given points starting from point K . The absolute difference between your solution and the main solution shouldn't exceed 10^-6 ; The shortest path consists of these moves: 2 -> 5 5 -> 4 4 -> 1 1 -> 3 There isn't any shorter path possible. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
131316922 |
nwi |
G |
Oct. 9, 2021, 11:09 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
109 |
7680000 |
|
|
131327857 |
yz6205 AhoCorasick Comet_Honeymoon |
G |
Oct. 9, 2021, 12:44 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
109 |
9830400 |
|
|
131309597 |
catalystgma popovicirobert Gioto |
G |
Oct. 9, 2021, 10:08 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
109 |
10342400 |
|
|
131330010 |
FrostStar oipotato chenjb |
G |
Oct. 9, 2021, 1:03 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
124 |
6963200 |
|
|
131320727 |
Mackerel_Pike MonkeyKing |
G |
Oct. 9, 2021, 11:40 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
124 |
19456000 |
|
|
131329479 |
FrostStar oipotato chenjb |
G |
Oct. 9, 2021, 12:59 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
140 |
6963200 |
|
|
131329617 |
FrostStar oipotato chenjb |
G |
Oct. 9, 2021, 1 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
156 |
6963200 |
|
|
131321809 |
Cornflakes leapfrog DPair |
G |
Oct. 9, 2021, 11:48 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
156 |
6963200 |
|
|
131328978 |
dXqwq shygo_cmll01 pigstd |
G |
Oct. 9, 2021, 12:54 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
171 |
8601600 |
|
|
131325730 |
songhaoran forever_lose colazcy |
G |
Oct. 9, 2021, 12:23 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
171 |
8601600 |
|
|
131311828 |
Um_nik Ormlis |
G |
Oct. 9, 2021, 10:25 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
93 |
8601600 |
|
|
131315416 |
lindongli2004 qazswedx2 Chameleon216 |
G |
Oct. 9, 2021, 10:56 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
108 |
15769600 |
|
|
131320239 |
awoo Neon vovuh |
G |
Oct. 9, 2021, 11:36 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
124 |
8499200 |
|
|
131320790 |
CuCl2 Eric_hooo KillerX |
G |
Oct. 9, 2021, 11:40 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
139 |
7782400 |
|
|
131326190 |
tamp_ Yousef_Salama |
G |
Oct. 9, 2021, 12:28 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
139 |
11673600 |
|
|
131380410 |
bllllltn |
G |
Oct. 10, 2021, 5:41 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
140 |
8908800 |
|
|
131325497 |
A-SOUL_Bella A-SOUL_Ava A-SOUL_Eileen |
G |
Oct. 9, 2021, 12:21 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
140 |
19763200 |
|
|
131327394 |
knandy cerberus97 aayush9 |
G |
Oct. 9, 2021, 12:39 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
155 |
6348800 |
|
|
131312658 |
afterall Amoo_Safar |
G |
Oct. 9, 2021, 10:32 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
170 |
10035200 |
|
|
131304499 |
xay5421 LJC00118 |
G |
Oct. 9, 2021, 9:29 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
171 |
8601600 |
|
|
131364018 |
SoMuchDrama |
G |
Oct. 9, 2021, 8:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
77 |
9113600 |
|
|
131309948 |
_yui_ 77o |
G |
Oct. 9, 2021, 10:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
78 |
14643200 |
|
|
131369436 |
cookiedoth rqi Egor.Lifar |
G |
Oct. 9, 2021, 11:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
92 |
10342400 |
|
|
131317035 |
DreamingLeaf tfg |
G |
Oct. 9, 2021, 11:09 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
8704000 |
|
|
131324506 |
DerekFeng xuziyuan burnoutag |
G |
Oct. 9, 2021, 12:11 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
8908800 |
|
|
131362572 |
couplefire |
G |
Oct. 9, 2021, 8 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
9728000 |
|
|
131317944 |
noimi pachico mtsd |
G |
Oct. 9, 2021, 11:16 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
11161600 |
|
|
131313365 |
Kaban-5 gnomina007 nikgaevoy |
G |
Oct. 9, 2021, 10:38 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
11571200 |
|
|
131307229 |
Denisson ShadowLight DmitryGrigorev |
G |
Oct. 9, 2021, 9:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
13312000 |
|
|
131313270 |
Iftekhar_Hakim_K noshin_faiza Roll_Num_56 |
G |
Oct. 9, 2021, 10:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
93 |
15769600 |
|
|
131316849 |
uwi nuip maspy |
G |
Oct. 9, 2021, 11:08 a.m. |
OK |
Java 11 |
TESTS |
48 |
280 |
31641600 |
|
|
131344255 |
dashing_ |
G |
Oct. 9, 2021, 3:38 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
311 |
8601600 |
|
|
131319313 |
tuna_salad |
G |
Oct. 9, 2021, 11:28 a.m. |
OK |
Rust |
TESTS |
48 |
108 |
12595200 |
|
|
131315205 |
qwerty787788 |
G |
Oct. 9, 2021, 10:54 a.m. |
OK |
Rust |
TESTS |
48 |
468 |
158208000 |
|
|
remove filters
Back to search problems