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.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
925
|
VK Cup 2018 - Round 3 |
FINISHED |
False |
9000 |
206815499 |
April 29, 2018, 1:15 p.m. |
Problems
B'Indiana Jones found ancient Aztec catacombs containing a golden idol. The catacombs consists of n caves. Each pair of caves is connected with a two-way corridor that can be opened or closed. The entrance to the catacombs is in the cave 1 , the idol and the exit are in the cave n . When Indiana goes from a cave x to a cave y using an open corridor, all corridors connected to the cave x change their state: all open corridors become closed, all closed corridors become open. Indiana wants to go from cave 1 to cave n going through as small number of corridors as possible. Help him find the optimal path, or determine that it is impossible to get out of catacombs. The first line contains two integers n and m ( 2 <= q n <= q 3 cdot 10^5 , 0 <= q m <= q 3 cdot 10^5 ) -- the number of caves and the number of open corridors at the initial moment. The next m lines describe the open corridors. The i -th of these lines contains two integers u_i and v_i ( 1 <= q u_i, v_i <= q n , u_i neq v_i ) -- the caves connected by the i -th open corridor. It is guaranteed that each unordered pair of caves is presented at most once. If there is a path to exit, in the first line print a single integer k -- the minimum number of corridors Indians should pass through ( 1 <= q k <= q 10^6 ). In the second line print k+1 integers x_0, ldots, x_k -- the number of caves in the order Indiana should visit them. The sequence x_0, ldots, x_k should satisfy the following: If there is no path, print a single integer -1 . We can show that if there is a path, there is a path consisting of no more than 10^6 corridors. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
37726717 |
Andrew_Makar BigBag |
D |
April 29, 2018, 3:33 p.m. |
OK |
GNU C++ |
TESTS |
39 |
514 |
19968000 |
|
2700 |
40978328 |
ReaLNero1 |
D |
July 30, 2018, 4:35 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
77 |
15564800 |
|
2700 |
37729839 |
__math |
D |
April 29, 2018, 5:27 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
156 |
22937600 |
|
2700 |
37724692 |
Copymaster Lilith |
D |
April 29, 2018, 3:14 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
202 |
19763200 |
|
2700 |
38464215 |
KMAASZRAA |
D |
May 20, 2018, 3:49 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
202 |
21708800 |
|
2700 |
37797588 |
CuriousCat.hzw |
D |
May 1, 2018, 12:01 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
202 |
47001600 |
|
2700 |
39021238 |
zhouyuyang |
D |
June 7, 2018, 12:38 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
233 |
18022400 |
|
2700 |
38984420 |
cjnwq |
D |
June 6, 2018, 5:43 a.m. |
OK |
GNU C++11 |
TESTS |
39 |
234 |
13414400 |
|
2700 |
37781018 |
danya090699 |
D |
April 30, 2018, 7:51 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
249 |
18534400 |
|
2700 |
37723647 |
Sert Alexandr_TS |
D |
April 29, 2018, 3:04 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
249 |
20070400 |
|
2700 |
37729164 |
tlwpdus |
D |
April 29, 2018, 4:41 p.m. |
OK |
GNU C++11 |
TESTS |
39 |
249 |
31436800 |
|
2700 |
37870154 |
jarakcyc |
D |
May 3, 2018, 6:54 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
217 |
20787200 |
|
2700 |
41461654 |
DEMOPON |
D |
Aug. 11, 2018, 8:52 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
218 |
14848000 |
|
2700 |
37997275 |
kut_kjb1994 |
D |
May 7, 2018, 1:47 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
218 |
23654400 |
|
2700 |
43443711 |
I_love_Y_UME |
D |
Sept. 26, 2018, 10:23 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
233 |
18432000 |
|
2700 |
38347454 |
Windbreaker |
D |
May 17, 2018, 11:53 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
234 |
33177600 |
|
2700 |
37719891 |
MrKaStep bixind |
D |
April 29, 2018, 2:31 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
249 |
19353600 |
|
2700 |
37733619 |
amethyst0 |
D |
April 29, 2018, 8:29 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
249 |
19763200 |
|
2700 |
37741806 |
TearinFree |
D |
April 30, 2018, 6:52 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
249 |
21708800 |
|
2700 |
45671234 |
lnhc1 |
D |
Nov. 13, 2018, 10:46 a.m. |
OK |
GNU C++14 |
TESTS |
39 |
249 |
29286400 |
|
2700 |
37730531 |
nuip |
D |
April 29, 2018, 5:58 p.m. |
OK |
GNU C++14 |
TESTS |
39 |
249 |
30515200 |
|
2700 |
46919572 |
ImpcO |
D |
Dec. 12, 2018, 2:54 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
217 |
15974400 |
|
2700 |
58057993 |
Gediminas |
D |
July 31, 2019, 6:15 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
218 |
14848000 |
|
2700 |
37746328 |
Jakube |
D |
April 30, 2018, 11 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
233 |
26521600 |
|
2700 |
38474204 |
Smaug |
D |
May 21, 2018, 4:50 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
249 |
20889600 |
|
2700 |
37725003 |
Au-Rikka Seemann |
D |
April 29, 2018, 3:17 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
249 |
22528000 |
|
2700 |
37729148 |
gepardo |
D |
April 29, 2018, 4:40 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
249 |
22732800 |
|
2700 |
43678913 |
ivan100sic |
D |
Oct. 2, 2018, 9:05 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
264 |
17715200 |
|
2700 |
37726061 |
kimden greencis |
D |
April 29, 2018, 3:27 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
264 |
30515200 |
|
2700 |
59698724 |
Slaaava |
D |
Aug. 30, 2019, 9:41 a.m. |
OK |
GNU C++17 |
TESTS |
39 |
280 |
22732800 |
|
2700 |
37719043 |
Golovanov399 I_hate_ACM |
D |
April 29, 2018, 2:24 p.m. |
OK |
GNU C++17 |
TESTS |
39 |
312 |
19046400 |
|
2700 |
38056128 |
unicorn20141 |
D |
May 8, 2018, 10:23 p.m. |
OK |
Java 8 |
TESTS |
39 |
670 |
61440000 |
|
2700 |
remove filters
Back to search problems