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 |
---|---|---|---|---|---|---|
232 | Codeforces Round 144 (Div. 1) | FINISHED | False | 7200 | 387210563 | Oct. 11, 2012, 3:30 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 292 ) | C | Doe Graphs | PROGRAMMING | constructive algorithms divide and conquer dp graphs shortest paths | 2700 |
B"John Doe decided that some mathematical object must be named after him. So he invented the Doe graphs. The Doe graphs are a family of undirected graphs, each of them is characterized by a single non-negative number -- its order. We'll denote a graph of order k as D(k), and we'll denote the number of vertices in the graph D(k) as |D(k)|. Then let's define the Doe graphs as follows: John thinks that Doe graphs are that great because for them exists a polynomial algorithm for the search of Hamiltonian path. However, your task is to answer queries of finding the shortest-length path between the vertices ai and bi in the graph D(n). A path between a pair of vertices u and v in the graph is a sequence of vertices x1, x2, ..., xk (k xe2 x80 x89> xe2 x80 x891) such, that x1 xe2 x80 x89= xe2 x80 x89u, xk xe2 x80 x89= xe2 x80 x89v, and for any i (i xe2 x80 x89< xe2 x80 x89k) vertices xi and xi xe2 x80 x89+ xe2 x80 x891 are connected by a graph edge. The length of path x1, x2, ..., xk is number (k xe2 x80 x89- xe2 x80 x891). The first line contains two integers t and n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89t xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89103) -- the number of queries and the order of the given graph. The i-th of the next t lines contains two integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891016, ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi) -- numbers of two vertices in the i-th query. It is guaranteed that ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|D(n)|. Please, do not use the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use cin, cout streams or the %I64d specifier. For each query print a single integer on a single line -- the length of the shortest path between vertices ai and bi. Print the answers to the queries in the order, in which the queries are given in the input."... |
Editorial for Codeforces Round #144 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
2356116 | Alex_2oo8 | C | Oct. 13, 2012, 5:04 p.m. | OK | Delphi | TESTS | 38 | 2453 | 0 | 2700 | |
2424415 | zxh809444285 | C | Oct. 25, 2012, 7:47 a.m. | OK | FPC | TESTS | 38 | 687 | 0 | 2700 | |
2700403 | ilyks | C | Dec. 6, 2012, 1:31 p.m. | OK | GNU C++ | TESTS | 38 | 390 | 0 | 2700 | |
2348711 | Ra16bit | C | Oct. 11, 2012, 7:32 p.m. | OK | GNU C++ | TESTS | 38 | 406 | 0 | 2700 | |
3321029 | robintylers | C | March 15, 2013, 12:58 p.m. | OK | GNU C++ | TESTS | 38 | 421 | 0 | 2700 | |
2632583 | hariprasath | C | Nov. 23, 2012, 1:30 p.m. | OK | GNU C++ | TESTS | 38 | 421 | 0 | 2700 | |
2565617 | tehkesih | C | Nov. 16, 2012, 3:17 a.m. | OK | GNU C++ | TESTS | 38 | 421 | 0 | 2700 | |
2386473 | dhh1995 | C | Oct. 19, 2012, 8:55 a.m. | OK | GNU C++ | TESTS | 38 | 421 | 0 | 2700 | |
3321115 | Rishabh | C | March 15, 2013, 1:10 p.m. | OK | GNU C++ | TESTS | 38 | 437 | 0 | 2700 | |
3290731 | robintylers | C | March 11, 2013, 3:03 p.m. | OK | GNU C++ | TESTS | 38 | 437 | 0 | 2700 | |
2693565 | vjudge2 | C | Dec. 4, 2012, 9:26 a.m. | OK | GNU C++ | TESTS | 38 | 437 | 0 | 2700 | |
2690228 | vjudge1 | C | Dec. 3, 2012, 7:46 a.m. | OK | GNU C++ | TESTS | 38 | 437 | 0 | 2700 | |
2348002 | cafelier | C | Oct. 11, 2012, 6:21 p.m. | OK | GNU C++0x | TESTS | 38 | 1265 | 0 | 2700 | |
7495942 | andrew.volchek | C | Aug. 17, 2014, 9:41 p.m. | OK | GNU C++0x | TESTS | 38 | 1340 | 0 | 2700 | |
6259493 | k0st1a | C | April 4, 2014, 5:15 p.m. | OK | GNU C++0x | TESTS | 38 | 1590 | 0 | 2700 | |
2769963 | ArkChar | C | Dec. 15, 2012, 11:20 a.m. | OK | GNU C++0x | TESTS | 38 | 2215 | 0 | 2700 | |
2769895 | ArkChar | C | Dec. 15, 2012, 11:05 a.m. | OK | GNU C++0x | TESTS | 38 | 2246 | 0 | 2700 | |
2769931 | ArkChar | C | Dec. 15, 2012, 11:12 a.m. | OK | GNU C++0x | TESTS | 38 | 2250 | 0 | 2700 | |
2769924 | ArkChar | C | Dec. 15, 2012, 11:10 a.m. | OK | GNU C++0x | TESTS | 38 | 2250 | 0 | 2700 | |
2769829 | ArkChar | C | Dec. 15, 2012, 10:48 a.m. | OK | GNU C++0x | TESTS | 38 | 2262 | 0 | 2700 | |
2769885 | ArkChar | C | Dec. 15, 2012, 11:03 a.m. | OK | GNU C++0x | TESTS | 38 | 2265 | 0 | 2700 | |
2769878 | ArkChar | C | Dec. 15, 2012, 11:01 a.m. | OK | GNU C++0x | TESTS | 38 | 2265 | 0 | 2700 | |
55061388 | SoiMae | C | June 3, 2019, 11:11 p.m. | OK | GNU C++11 | TESTS | 38 | 374 | 0 | 2700 | |
44600155 | luogu_bot1 | C | Oct. 20, 2018, 1:59 p.m. | OK | GNU C++11 | TESTS | 38 | 404 | 0 | 2700 | |
63100206 | luogu_bot1 | C | Oct. 21, 2019, 11:38 p.m. | OK | GNU C++11 | TESTS | 38 | 404 | 307200 | 2700 | |
44623581 | luogu_bot1 | C | Oct. 21, 2018, 7:53 a.m. | OK | GNU C++11 | TESTS | 38 | 434 | 102400 | 2700 | |
44623260 | luogu_bot2 | C | Oct. 21, 2018, 7:43 a.m. | OK | GNU C++11 | TESTS | 38 | 434 | 102400 | 2700 | |
49688537 | luogu_bot2 | C | Feb. 10, 2019, 9:41 a.m. | OK | GNU C++11 | TESTS | 38 | 436 | 0 | 2700 | |
49819403 | inline | C | Feb. 12, 2019, 8 a.m. | OK | GNU C++11 | TESTS | 38 | 466 | 0 | 2700 | |
49688257 | luogu_bot1 | C | Feb. 10, 2019, 9:20 a.m. | OK | GNU C++11 | TESTS | 38 | 466 | 0 | 2700 | |
49871575 | luogu_bot4 | C | Feb. 13, 2019, 2:05 p.m. | OK | GNU C++11 | TESTS | 38 | 466 | 102400 | 2700 | |
44623287 | liang_liang | C | Oct. 21, 2018, 7:44 a.m. | OK | GNU C++11 | TESTS | 38 | 466 | 102400 | 2700 | |
23667407 | Ali.Pi | C | Jan. 9, 2017, 4:55 p.m. | OK | GNU C++14 | TESTS | 38 | 622 | 1945600 | 2700 | |
24135282 | KhaledKEE | C | Jan. 25, 2017, 6:46 p.m. | OK | GNU C++14 | TESTS | 38 | 872 | 1945600 | 2700 | |
61412830 | newbiegcz | C | Sept. 28, 2019, 9:17 a.m. | OK | GNU C++14 | TESTS | 38 | 902 | 0 | 2700 | |
57101823 | Jester | C | July 15, 2019, 2:02 p.m. | OK | GNU C++14 | TESTS | 38 | 1340 | 0 | 2700 | |
57101694 | Jester | C | July 15, 2019, 1:59 p.m. | OK | GNU C++14 | TESTS | 38 | 1340 | 0 | 2700 | |
57101643 | Jester | C | July 15, 2019, 1:58 p.m. | OK | GNU C++14 | TESTS | 38 | 1528 | 102400 | 2700 | |
32961152 | cyz666 | C | Dec. 6, 2017, 3:39 a.m. | OK | GNU C++14 | TESTS | 38 | 1746 | 1945600 | 2700 | |
67270515 | ElangBondol | C | Dec. 20, 2019, 8:04 a.m. | OK | GNU C++14 | TESTS | 38 | 2182 | 0 | 2700 | |
54449736 | MELNIKOFF_OLEG | C | May 21, 2019, 1:01 p.m. | OK | GNU C++14 | TESTS | 38 | 2182 | 204800 | 2700 | |
56150416 | Scut82 | C | June 27, 2019, 7:57 a.m. | OK | GNU C++14 | TESTS | 38 | 2462 | 204800 | 2700 | |
47174008 | DomiKo | C | Dec. 17, 2018, 4:31 p.m. | OK | GNU C++17 | TESTS | 38 | 466 | 0 | 2700 | |
44580290 | hyfzbtrs | C | Oct. 20, 2018, 8:24 a.m. | OK | GNU C++17 | TESTS | 38 | 498 | 0 | 2700 | |
50473463 | ruo | C | Feb. 25, 2019, 3:44 a.m. | OK | GNU C++17 | TESTS | 38 | 622 | 0 | 2700 | |
66205179 | hjk1030 | C | Dec. 3, 2019, 2 a.m. | OK | GNU C++17 | TESTS | 38 | 716 | 0 | 2700 | |
60708140 | Xellos | C | Sept. 17, 2019, 6:37 a.m. | OK | GNU C++17 | TESTS | 38 | 1216 | 0 | 2700 | |
47172955 | DomiKo | C | Dec. 17, 2018, 3:59 p.m. | OK | GNU C++17 | TESTS | 38 | 2120 | 0 | 2700 | |
47181358 | DomiKo | C | Dec. 17, 2018, 9:14 p.m. | OK | GNU C++17 | TESTS | 38 | 2464 | 0 | 2700 | |
47181438 | DomiKo | C | Dec. 17, 2018, 9:20 p.m. | OK | GNU C++17 | TESTS | 38 | 2494 | 0 | 2700 | |
47181376 | DomiKo | C | Dec. 17, 2018, 9:15 p.m. | OK | GNU C++17 | TESTS | 38 | 2494 | 0 | 2700 | |
47181382 | DomiKo | C | Dec. 17, 2018, 9:15 p.m. | OK | GNU C++17 | TESTS | 38 | 2588 | 0 | 2700 | |
3747447 | PlayLikeNeverB4 | C | May 19, 2013, 9:21 p.m. | OK | Java 7 | TESTS | 38 | 2171 | 0 | 2700 | |
2347949 | OgieKako | C | Oct. 11, 2012, 6:17 p.m. | OK | Java 7 | TESTS | 38 | 2328 | 102400 | 2700 | |
3554871 | RAD | C | April 17, 2013, 3:41 a.m. | OK | MS C++ | TESTS | 38 | 546 | 0 | 2700 | |
49869970 | vjudge5 | C | Feb. 13, 2019, 1:32 p.m. | OK | MS C++ | TESTS | 38 | 622 | 102400 | 2700 | |
49872408 | vjudge4 | C | Feb. 13, 2019, 2:22 p.m. | OK | MS C++ | TESTS | 38 | 654 | 0 | 2700 | |
49871769 | vjudge4 | C | Feb. 13, 2019, 2:09 p.m. | OK | MS C++ | TESTS | 38 | 654 | 0 | 2700 | |
49872157 | vjudge2 | C | Feb. 13, 2019, 2:17 p.m. | OK | MS C++ | TESTS | 38 | 684 | 0 | 2700 | |
49871565 | vjudge1 | C | Feb. 13, 2019, 2:05 p.m. | OK | MS C++ | TESTS | 38 | 686 | 102400 | 2700 | |
2348392 | pooya_ | C | Oct. 11, 2012, 6:45 p.m. | OK | MS C++ | TESTS | 38 | 781 | 0 | 2700 | |
11382653 | josdas | C | June 1, 2015, 7:09 p.m. | OK | MS C++ | TESTS | 38 | 1934 | 0 | 2700 | |
11382825 | josdas | C | June 1, 2015, 7:30 p.m. | OK | MS C++ | TESTS | 38 | 2058 | 0 | 2700 | |
2353358 | NALP | C | Oct. 12, 2012, 8:25 p.m. | OK | MS C++ | TESTS | 38 | 2125 | 0 | 2700 | |
67489998 | StrickenMaple05 | C | Dec. 23, 2019, 6:58 p.m. | OK | MS C++ 2017 | TESTS | 38 | 498 | 0 | 2700 | |
67489894 | StrickenMaple05 | C | Dec. 23, 2019, 6:56 p.m. | OK | MS C++ 2017 | TESTS | 38 | 498 | 0 | 2700 | |
67490582 | StrickenMaple05 | C | Dec. 23, 2019, 7:13 p.m. | OK | MS C++ 2017 | TESTS | 38 | 528 | 0 | 2700 | |
67490531 | StrickenMaple05 | C | Dec. 23, 2019, 7:11 p.m. | OK | MS C++ 2017 | TESTS | 38 | 530 | 0 | 2700 | |
67490489 | StrickenMaple05 | C | Dec. 23, 2019, 7:10 p.m. | OK | MS C++ 2017 | TESTS | 38 | 530 | 0 | 2700 | |
67490244 | StrickenMaple05 | C | Dec. 23, 2019, 7:04 p.m. | OK | MS C++ 2017 | TESTS | 38 | 560 | 0 | 2700 | |
67768155 | 43art | C | Dec. 28, 2019, 5:25 a.m. | OK | MS C++ 2017 | TESTS | 38 | 1590 | 2662400 | 2700 | |
67434371 | dell_ | C | Dec. 22, 2019, 4:30 p.m. | OK | MS C++ 2017 | TESTS | 38 | 1620 | 0 | 2700 | |
66883937 | artyomonyanov | C | Dec. 14, 2019, 5:32 p.m. | OK | MS C++ 2017 | TESTS | 38 | 1620 | 0 | 2700 | |
67485654 | femperox | C | Dec. 23, 2019, 5:22 p.m. | OK | MS C++ 2017 | TESTS | 38 | 1622 | 307200 | 2700 |
Back to search problems