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 |
|---|---|---|---|---|---|---|
| 763 | Codeforces Round 395 (Div. 1) | FINISHED | False | 7200 | 290363123 | Feb. 2, 2017, 1:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 644 ) | D | Timofey and a flat tree | PROGRAMMING | data structures graphs hashing shortest paths trees | 2800 |
Little Timofey has a big tree — an undirected connected graph with n vertices and no simple cycles. He likes to walk along it. His tree is flat so when he walks along it he sees it entirely. Quite naturally, when he stands on a vertex, he sees the tree as a rooted tree with the root in this vertex. Timofey assumes that the more non-isomorphic subtrees are there in the tree, the more beautiful the tree is. A subtree of a vertex is a subgraph containing this vertex and all its descendants. You should tell Timofey the vertex in which he should stand to see the most beautiful rooted tree. Subtrees of vertices u and v are isomorphic if the number of children of u equals the number of children of v , and their children can be arranged in such a way that the subtree of the first son of u is isomorphic to the subtree of the first son of v , the subtree of the second son of u is isomorphic to the subtree of the second son of v , and so on. In particular, subtrees consisting of single vertex are isomorphic to each other. First line contains single integer n ( 1 ≤ n ≤ 10 5 ) — number of vertices in the tree. Each of the next n - 1 lines contains two integers u i and v i ( 1 ≤ u i , v i ≤ 10 5 , u i ≠ v i ), denoting the vertices the i -th edge connects. It is guaranteed that the given graph is a tree. Print single integer — the index of the vertex in which Timofey should stand. If there are many answers, you can print any of them. In the first example we can stand in the vertex 1 or in the vertex 3 so that every subtree is non-isomorphic. If we stand in the vertex 2 , then subtrees of vertices 1 and 3 are isomorphic. In the second example, if we stand in the vertex 1 , then only subtrees of vertices 4 and 5 are isomorphic. In the third example, if we stand in the vertex 1 , then subtrees of vertices 2 , 3 , 4 , 6 , 7 and 8 are isomorphic. If we stand in the vertex 2 , than only subtrees of vertices 3 , 4 , 6 , 7 and 8 are isomorphic. If we stand in the vertex 5 , the |
| Codeforces Round #395 [Editorial] |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 25157872 | rainboy | D | March 2, 2017, 7:53 p.m. | OK | GNU C | TESTS | 101 | 218 | 27648000 | 2800 | |
| 24626320 | imverypupil | D | Feb. 13, 2017, 11:20 a.m. | OK | GNU C++ | TESTS | 101 | 46 | 24780800 | 2800 | |
| 40982570 | ReaLNero1 | D | July 30, 2018, 6:28 p.m. | OK | GNU C++ | TESTS | 101 | 62 | 17612800 | 2800 | |
| 24618944 | Dylans | D | Feb. 13, 2017, 12:40 a.m. | OK | GNU C++ | TESTS | 101 | 62 | 19763200 | 2800 | |
| 24626296 | imverypupil | D | Feb. 13, 2017, 11:19 a.m. | OK | GNU C++ | TESTS | 101 | 62 | 20480000 | 2800 | |
| 27722369 | rqgao2014 | D | June 11, 2017, 2:19 p.m. | OK | GNU C++ | TESTS | 101 | 77 | 10240000 | 2800 | |
| 27722310 | rqgao2014 | D | June 11, 2017, 2:15 p.m. | OK | GNU C++ | TESTS | 101 | 78 | 10240000 | 2800 | |
| 24404368 | AkaneSasu | D | Feb. 3, 2017, 7:32 a.m. | OK | GNU C++ | TESTS | 101 | 109 | 18739200 | 2800 | |
| 24729464 | Hermera | D | Feb. 17, 2017, 1:35 a.m. | OK | GNU C++ | TESTS | 101 | 124 | 21299200 | 2800 | |
| 24432624 | zgncycz | D | Feb. 4, 2017, 1:06 p.m. | OK | GNU C++ | TESTS | 101 | 155 | 27340800 | 2800 | |
| 24792381 | lichang | D | Feb. 19, 2017, 1:17 a.m. | OK | GNU C++ | TESTS | 101 | 156 | 16588800 | 2800 | |
| 25706285 | J_X | D | March 22, 2017, 8:22 a.m. | OK | GNU C++11 | TESTS | 101 | 78 | 12902400 | 2800 | |
| 51061449 | ORG | D | March 9, 2019, 3:14 a.m. | OK | GNU C++11 | TESTS | 101 | 93 | 20684800 | 2800 | |
| 51044931 | ORG | D | March 8, 2019, 6:21 p.m. | OK | GNU C++11 | TESTS | 101 | 108 | 20684800 | 2800 | |
| 31230436 | RNS_JKS | D | Oct. 12, 2017, 1:51 a.m. | OK | GNU C++11 | TESTS | 101 | 109 | 14848000 | 2800 | |
| 24729032 | Talon_F | D | Feb. 17, 2017, 12:59 a.m. | OK | GNU C++11 | TESTS | 101 | 109 | 16486400 | 2800 | |
| 51061563 | vjudge1 | D | March 9, 2019, 3:18 a.m. | OK | GNU C++11 | TESTS | 101 | 124 | 20684800 | 2800 | |
| 24624112 | King_George | D | Feb. 13, 2017, 8:27 a.m. | OK | GNU C++11 | TESTS | 101 | 139 | 16998400 | 2800 | |
| 24402804 | Chelly | D | Feb. 3, 2017, 6:02 a.m. | OK | GNU C++11 | TESTS | 101 | 140 | 10752000 | 2800 | |
| 24468691 | chitanda | D | Feb. 6, 2017, 12:59 p.m. | OK | GNU C++11 | TESTS | 101 | 140 | 13414400 | 2800 | |
| 31229867 | RNS_JKS | D | Oct. 12, 2017, 1 a.m. | OK | GNU C++11 | TESTS | 101 | 140 | 14848000 | 2800 | |
| 27288677 | rawatds | D | May 22, 2017, 5:23 p.m. | OK | GNU C++14 | TESTS | 101 | 124 | 12595200 | 2800 | |
| 24423788 | nihalpi1 | D | Feb. 4, 2017, 3:14 a.m. | OK | GNU C++14 | TESTS | 101 | 124 | 15360000 | 2800 | |
| 25654914 | Jakube | D | March 19, 2017, 8:19 p.m. | OK | GNU C++14 | TESTS | 101 | 139 | 13721600 | 2800 | |
| 24392124 | Belonogov | D | Feb. 2, 2017, 5:57 p.m. | OK | GNU C++14 | TESTS | 101 | 171 | 13619200 | 2800 | |
| 24468268 | fetetriste | D | Feb. 6, 2017, 12:36 p.m. | OK | GNU C++14 | TESTS | 101 | 171 | 15360000 | 2800 | |
| 25885792 | Philipsweng | D | March 29, 2017, 1:31 a.m. | OK | GNU C++14 | TESTS | 101 | 171 | 21299200 | 2800 | |
| 50770229 | riteme | D | March 4, 2019, 3:55 a.m. | OK | GNU C++14 | TESTS | 101 | 171 | 23961600 | 2800 | |
| 59380019 | Scut82 | D | Aug. 24, 2019, 2:15 a.m. | OK | GNU C++14 | TESTS | 101 | 186 | 19456000 | 2800 | |
| 50770215 | riteme | D | March 4, 2019, 3:54 a.m. | OK | GNU C++14 | TESTS | 101 | 187 | 25497600 | 2800 | |
| 24408683 | Egor.Lifar | D | Feb. 3, 2017, 11:32 a.m. | OK | GNU C++14 | TESTS | 101 | 187 | 30924800 | 2800 | |
| 67862016 | hjk1030 | D | Dec. 29, 2019, 8:28 a.m. | OK | GNU C++17 | TESTS | 101 | 156 | 19660800 | 2800 | |
| 50512326 | lpa20020220 | D | Feb. 26, 2019, 2:31 a.m. | OK | GNU C++17 | TESTS | 101 | 156 | 22732800 | 2800 | |
| 62957327 | lukecavabarrett | D | Oct. 19, 2019, 9:14 p.m. | OK | GNU C++17 | TESTS | 101 | 202 | 37683200 | 2800 | |
| 50905148 | ArshiaDadras | D | March 6, 2019, 7:34 p.m. | OK | GNU C++17 | TESTS | 101 | 218 | 25702400 | 2800 | |
| 51074641 | AzRush | D | March 9, 2019, 8:58 a.m. | OK | GNU C++17 | TESTS | 101 | 234 | 17817600 | 2800 | |
| 62957382 | lukecavabarrett | D | Oct. 19, 2019, 9:16 p.m. | OK | GNU C++17 | TESTS | 101 | 249 | 42496000 | 2800 | |
| 60902627 | vjudge1 | D | Sept. 19, 2019, 11:24 p.m. | OK | GNU C++17 | TESTS | 101 | 296 | 19456000 | 2800 | |
| 61341686 | AliShahali1382 | D | Sept. 26, 2019, 10:36 p.m. | OK | GNU C++17 | TESTS | 101 | 342 | 35123200 | 2800 | |
| 57108769 | Benq | D | July 15, 2019, 4:23 p.m. | OK | GNU C++17 | TESTS | 101 | 373 | 38195200 | 2800 | |
| 64759891 | AM. | D | Nov. 12, 2019, 6:37 p.m. | OK | GNU C++17 | TESTS | 101 | 545 | 27648000 | 2800 | |
| 50043243 | tri | D | Feb. 17, 2019, 3:53 a.m. | OK | Java 8 | TESTS | 101 | 670 | 53452800 | 2800 | |
| 25277780 | JialinOuyang | D | March 6, 2017, 3 a.m. | OK | Java 8 | TESTS | 101 | 670 | 93900800 | 2800 | |
| 24490654 | IgorKoval | D | Feb. 7, 2017, 3:07 p.m. | OK | Java 8 | TESTS | 101 | 857 | 109465600 | 2800 | |
| 24490561 | IgorKoval | D | Feb. 7, 2017, 3:01 p.m. | OK | Java 8 | TESTS | 101 | 873 | 105574400 | 2800 | |
| 24464610 | fetetriste | D | Feb. 6, 2017, 8 a.m. | OK | Java 8 | TESTS | 101 | 904 | 69324800 | 2800 | |
| 24744268 | Dukkha | D | Feb. 17, 2017, 6:42 p.m. | OK | Java 8 | TESTS | 101 | 904 | 88883200 | 2800 | |
| 24394580 | mmaxio | D | Feb. 2, 2017, 7:30 p.m. | OK | Java 8 | TESTS | 101 | 967 | 113152000 | 2800 | |
| 24384757 | uwi | D | Feb. 2, 2017, 3:18 p.m. | OK | Java 8 | TESTS | 101 | 1029 | 155033600 | 2800 | |
| 24490765 | IgorKoval | D | Feb. 7, 2017, 3:14 p.m. | OK | Java 8 | TESTS | 101 | 1060 | 109465600 | 2800 | |
| 27260494 | hama-du | D | May 21, 2017, 6:41 a.m. | OK | Java 8 | TESTS | 101 | 1169 | 109260800 | 2800 | |
| 65335579 | Madball | D | Nov. 19, 2019, 8:46 a.m. | OK | MS C++ 2017 | TESTS | 101 | 561 | 34918400 | 2800 |
Back to search problems