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 |
---|---|---|---|---|---|---|
372 | Codeforces Round 219 (Div. 1) | FINISHED | False | 7200 | 344879999 | Dec. 13, 2013, 2 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 989 ) | D | Choosing Subtree is Fun | PROGRAMMING | binary search data structures dfs and similar trees two pointers | 2600 |
B"There is a tree consisting of n vertices. The vertices are numbered from 1 to n. Let's define the length of an interval [l, xe2 x80 x89r] as the value r xe2 x80 x89- xe2 x80 x89l xe2 x80 x89+ xe2 x80 x891. The score of a subtree of this tree is the maximum length of such an interval [l, xe2 x80 x89r] that, the vertices with numbers l, xe2 x80 x89l xe2 x80 x89+ xe2 x80 x891, xe2 x80 x89..., xe2 x80 x89r belong to the subtree. Considering all subtrees of the tree whose size is at most k, return the maximum score of the subtree. Note, that in this problem tree is not rooted, so a subtree -- is an arbitrary connected subgraph of the tree. There are two integers in the first line, n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Each of the next n xe2 x80 x89- xe2 x80 x891 lines contains 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 x89n, xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89bi). That means ai and bi are connected by a tree edge. It is guaranteed that the input represents a tree. Output should contain a single integer -- the maximum possible score. For the first case, there is some subtree whose size is at most 6, including 3 consecutive numbers of vertices. For example, the subtree that consists of {1, xe2 x80 x893, xe2 x80 x894, xe2 x80 x895, xe2 x80 x897, xe2 x80 x898} or of {1, xe2 x80 x894, xe2 x80 x896, xe2 x80 x897, xe2 x80 x898, xe2 x80 x8910} includes 3 consecutive numbers of vertices. But there is no subtree whose size is at most 6, which includes 4 or more consecutive numbers of vertices."... |
9944 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
7674438 | zyh | D | Sept. 3, 2014, 12:49 p.m. | OK | GNU C++ | TESTS | 47 | 108 | 26316800 | 2600 | |
9286869 | Al.Cash | D | Dec. 27, 2014, 7:36 p.m. | OK | GNU C++ | TESTS | 47 | 124 | 10649600 | 2600 | |
8154405 | Al.Cash | D | Oct. 9, 2014, 11:39 a.m. | OK | GNU C++ | TESTS | 47 | 124 | 10752000 | 2600 | |
8152820 | Al.Cash | D | Oct. 9, 2014, 10:44 a.m. | OK | GNU C++ | TESTS | 47 | 124 | 10752000 | 2600 | |
8152788 | Al.Cash | D | Oct. 9, 2014, 10:41 a.m. | OK | GNU C++ | TESTS | 47 | 124 | 10752000 | 2600 | |
40989281 | ReaLNero1 | D | July 30, 2018, 10:46 p.m. | OK | GNU C++ | TESTS | 47 | 124 | 18432000 | 2600 | |
5435721 | orzxyz111 | D | Dec. 14, 2013, 12:54 a.m. | OK | GNU C++ | TESTS | 47 | 124 | 18636800 | 2600 | |
5438485 | wakaka | D | Dec. 14, 2013, 10:20 a.m. | OK | GNU C++ | TESTS | 47 | 124 | 25804800 | 2600 | |
9270811 | Al.Cash | D | Dec. 25, 2014, 7:23 p.m. | OK | GNU C++ | TESTS | 47 | 140 | 10649600 | 2600 | |
8154343 | Al.Cash | D | Oct. 9, 2014, 11:34 a.m. | OK | GNU C++ | TESTS | 47 | 140 | 10752000 | 2600 | |
5631367 | lost3030 | D | Jan. 7, 2014, 8:01 a.m. | OK | GNU C++0x | TESTS | 47 | 202 | 18432000 | 2600 | |
5530775 | Zuza | D | Dec. 27, 2013, 2:15 p.m. | OK | GNU C++0x | TESTS | 47 | 218 | 17817600 | 2600 | |
5433251 | Shik | D | Dec. 13, 2013, 5:11 p.m. | OK | GNU C++0x | TESTS | 47 | 218 | 18227200 | 2600 | |
7692925 | Konoha | D | Sept. 6, 2014, 8:53 a.m. | OK | GNU C++0x | TESTS | 47 | 218 | 19456000 | 2600 | |
6863310 | persianpars | D | June 11, 2014, 9:29 a.m. | OK | GNU C++0x | TESTS | 47 | 218 | 19456000 | 2600 | |
5440487 | hex539 | D | Dec. 14, 2013, 4:20 p.m. | OK | GNU C++0x | TESTS | 47 | 218 | 21401600 | 2600 | |
6863373 | persianpars | D | June 11, 2014, 9:45 a.m. | OK | GNU C++0x | TESTS | 47 | 234 | 18227200 | 2600 | |
5430674 | tomasz.kociumaka | D | Dec. 13, 2013, 3:45 p.m. | OK | GNU C++0x | TESTS | 47 | 234 | 20992000 | 2600 | |
9443980 | RealEyes | D | Jan. 16, 2015, 2:11 p.m. | OK | GNU C++0x | TESTS | 47 | 234 | 25190400 | 2600 | |
9443931 | RealEyes | D | Jan. 16, 2015, 2:03 p.m. | OK | GNU C++0x | TESTS | 47 | 234 | 25190400 | 2600 | |
19155635 | immortalCO | D | July 15, 2016, 2:30 p.m. | OK | GNU C++11 | TESTS | 47 | 124 | 10444800 | 2600 | |
19155566 | immortalCO | D | July 15, 2016, 2:26 p.m. | OK | GNU C++11 | TESTS | 47 | 140 | 10444800 | 2600 | |
17277291 | kefaa | D | April 11, 2016, 12:07 p.m. | OK | GNU C++11 | TESTS | 47 | 140 | 18432000 | 2600 | |
16944316 | Penny_Lane | D | March 26, 2016, 5:49 a.m. | OK | GNU C++11 | TESTS | 47 | 155 | 24576000 | 2600 | |
17277230 | kefaa | D | April 11, 2016, 12:02 p.m. | OK | GNU C++11 | TESTS | 47 | 156 | 18841600 | 2600 | |
12480056 | -XraY- | D | Aug. 12, 2015, 1:21 p.m. | OK | GNU C++11 | TESTS | 47 | 156 | 40140800 | 2600 | |
55185434 | SoiMae | D | June 6, 2019, 3:06 a.m. | OK | GNU C++11 | TESTS | 47 | 171 | 16486400 | 2600 | |
17278450 | kefaa | D | April 11, 2016, 1:31 p.m. | OK | GNU C++11 | TESTS | 47 | 171 | 18432000 | 2600 | |
18372467 | lungly1 | D | June 11, 2016, 10:08 a.m. | OK | GNU C++11 | TESTS | 47 | 171 | 18534400 | 2600 | |
17392975 | bardek | D | April 19, 2016, 10:38 p.m. | OK | GNU C++11 | TESTS | 47 | 171 | 20172800 | 2600 | |
61760656 | problem-solved | D | Oct. 3, 2019, 6:59 a.m. | OK | GNU C++14 | TESTS | 47 | 187 | 17408000 | 2600 | |
40726874 | fofao_funk | D | July 25, 2018, 5:30 a.m. | OK | GNU C++14 | TESTS | 47 | 187 | 19046400 | 2600 | |
36406388 | The_Unbeatable | D | March 19, 2018, 9:12 a.m. | OK | GNU C++14 | TESTS | 47 | 202 | 17612800 | 2600 | |
45710177 | H.D.T | D | Nov. 14, 2018, 1:42 p.m. | OK | GNU C++14 | TESTS | 47 | 202 | 18432000 | 2600 | |
45712155 | T.V_N | D | Nov. 14, 2018, 2:42 p.m. | OK | GNU C++14 | TESTS | 47 | 202 | 19148800 | 2600 | |
45696099 | U_U | D | Nov. 14, 2018, 3:28 a.m. | OK | GNU C++14 | TESTS | 47 | 202 | 20684800 | 2600 | |
38749135 | ArshiaDadras | D | May 29, 2018, 5:31 p.m. | OK | GNU C++14 | TESTS | 47 | 217 | 20992000 | 2600 | |
67691690 | Origenes | D | Dec. 27, 2019, 11:24 a.m. | OK | GNU C++14 | TESTS | 47 | 233 | 19353600 | 2600 | |
34713698 | tymo | D | Jan. 30, 2018, 3:26 p.m. | OK | GNU C++14 | TESTS | 47 | 233 | 23347200 | 2600 | |
29969086 | fengsuiyan | D | Sept. 1, 2017, 10:51 a.m. | OK | GNU C++14 | TESTS | 47 | 249 | 19456000 | 2600 | |
45086535 | HappyEnd | D | Oct. 30, 2018, 7:41 a.m. | OK | GNU C++17 | TESTS | 47 | 156 | 14233600 | 2600 | |
56822617 | dvdg6566 | D | July 11, 2019, 1:55 a.m. | OK | GNU C++17 | TESTS | 47 | 187 | 20172800 | 2600 | |
55469337 | isaf27 | D | June 11, 2019, 5:54 p.m. | OK | GNU C++17 | TESTS | 47 | 218 | 44441600 | 2600 | |
51427983 | lis | D | March 17, 2019, 8:40 p.m. | OK | GNU C++17 | TESTS | 47 | 233 | 17408000 | 2600 | |
47845674 | amnesiac_dusk | D | Jan. 2, 2019, 2:31 p.m. | OK | GNU C++17 | TESTS | 47 | 249 | 16179200 | 2600 | |
58603931 | dragonslayerintraining | D | Aug. 11, 2019, 1:42 p.m. | OK | GNU C++17 | TESTS | 47 | 249 | 19456000 | 2600 | |
60351915 | AliShahali1382 | D | Sept. 10, 2019, 2:37 p.m. | OK | GNU C++17 | TESTS | 47 | 264 | 21401600 | 2600 | |
56152745 | ruo | D | June 27, 2019, 8:48 a.m. | OK | GNU C++17 | TESTS | 47 | 265 | 21811200 | 2600 | |
47845656 | amnesiac_dusk | D | Jan. 2, 2019, 2:31 p.m. | OK | GNU C++17 | TESTS | 47 | 265 | 27443200 | 2600 | |
60314928 | saketh | D | Sept. 9, 2019, 5:25 p.m. | OK | GNU C++17 | TESTS | 47 | 265 | 82124800 | 2600 | |
5528402 | kelvinlau | D | Dec. 27, 2013, 5:50 a.m. | OK | Go | TESTS | 47 | 499 | 23552000 | 2600 | |
5528656 | kelvinlau | D | Dec. 27, 2013, 7:05 a.m. | OK | Go | TESTS | 47 | 546 | 26828800 | 2600 | |
5433528 | uwi | D | Dec. 13, 2013, 5:33 p.m. | OK | Java 6 | TESTS | 47 | 374 | 13209600 | 2600 | |
5431661 | uwi | D | Dec. 13, 2013, 3:59 p.m. | OK | Java 6 | TESTS | 47 | 2558 | 46387200 | 2600 | |
5485490 | uwi | D | Dec. 21, 2013, 7:14 a.m. | OK | Java 7 | TESTS | 47 | 234 | 0 | 2600 | |
5546562 | xenoslash | D | Dec. 29, 2013, 8:31 a.m. | OK | Java 7 | TESTS | 47 | 483 | 20992000 | 2600 | |
5432927 | Egor | D | Dec. 13, 2013, 4:55 p.m. | OK | Java 7 | TESTS | 47 | 1123 | 40448000 | 2600 | |
7697502 | IgorKoval | D | Sept. 6, 2014, 11:37 p.m. | OK | Java 8 | TESTS | 47 | 1076 | 11264000 | 2600 | |
10374681 | azukun | D | March 21, 2015, 6:42 a.m. | OK | MS C# | TESTS | 47 | 670 | 32870400 | 2600 | |
5438984 | kcm1700 | D | Dec. 14, 2013, noon | OK | MS C++ | TESTS | 47 | 156 | 12595200 | 2600 | |
7609057 | mjy0503 | D | Aug. 27, 2014, 9:57 p.m. | OK | MS C++ | TESTS | 47 | 202 | 17817600 | 2600 | |
11067726 | polequoll | D | May 11, 2015, 6:43 a.m. | OK | MS C++ | TESTS | 47 | 218 | 15667200 | 2600 | |
5431697 | Merkurev | D | Dec. 13, 2013, 3:59 p.m. | OK | MS C++ | TESTS | 47 | 280 | 18534400 | 2600 | |
6161798 | blueseen | D | March 27, 2014, 1:35 p.m. | OK | MS C++ | TESTS | 47 | 311 | 18124800 | 2600 | |
5431746 | GlebsHP | D | Dec. 13, 2013, 3:59 p.m. | OK | MS C++ | TESTS | 47 | 343 | 30105600 | 2600 | |
5482462 | NALP | D | Dec. 20, 2013, 6:25 p.m. | OK | MS C++ | TESTS | 47 | 390 | 22630400 | 2600 | |
5433726 | 19891101 | D | Dec. 13, 2013, 5:52 p.m. | OK | MS C++ | TESTS | 47 | 1716 | 17817600 | 2600 | |
5433705 | 19891101 | D | Dec. 13, 2013, 5:49 p.m. | OK | MS C++ | TESTS | 47 | 1950 | 17817600 | 2600 | |
5433395 | Im_too_old_for_this_shit | D | Dec. 13, 2013, 5:23 p.m. | OK | MS C++ | TESTS | 47 | 3447 | 71577600 | 2600 |
Back to search problems