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 |
|---|---|---|---|---|---|---|
| 748 | Technocup 2017 - Elimination Round 3 | FINISHED | False | 7200 | 293748923 | Dec. 25, 2016, 9:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 711 ) | F | Santa Clauses and a Soccer Championship | PROGRAMMING | constructive algorithms dfs and similar graphs trees | 2500 |
The country Treeland consists of n cities connected with n - 1 bidirectional roads in such a way that it's possible to reach every city starting from any other city using these roads. There will be a soccer championship next year, and all participants are Santa Clauses. There are exactly 2 k teams from 2 k different cities. During the first stage all teams are divided into k pairs. Teams of each pair play two games against each other: one in the hometown of the first team, and the other in the hometown of the other team. Thus, each of the 2 k cities holds exactly one soccer game. However, it's not decided yet how to divide teams into pairs. It's also necessary to choose several cities to settle players in. Organizers tend to use as few cities as possible to settle the teams. Nobody wants to travel too much during the championship, so if a team plays in cities u and v , it wants to live in one of the cities on the shortest path between u and v (maybe, in u or in v ). There is another constraint also: the teams from one pair must live in the same city. Summarizing, the organizers want to divide 2 k teams into pairs and settle them in the minimum possible number of cities m in such a way that teams from each pair live in the same city which lies between their hometowns. The first line of input contains two integers n and k ( 2 ≤ n ≤ 2·10 5 , 2 ≤ 2 k ≤ n ) — the number of cities in Treeland and the number of pairs of teams, respectively. The following n - 1 lines describe roads in Treeland: each of these lines contains two integers a and b ( 1 ≤ a , b ≤ n , a ≠ b ) which mean that there is a road between cities a and b . It's guaranteed that there is a path between any two cities. The last line contains 2 k distinct integers c 1 , c 2 , ..., c 2 k ( 1 ≤ c i ≤ n ), where c i is the hometown of the i -th team. All these numbers are distinct. The first line of output must contain the only positive integer m which should be equal to the minimum possible number of |
| Codeforces Round 389 (Div.2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 23339118 | CuSO45H2O | F | Dec. 26, 2016, 11:39 a.m. | OK | GNU C++ | TESTS | 125 | 93 | 24985600 | 2500 | |
| 23339195 | CuSO45H2O | F | Dec. 26, 2016, 11:44 a.m. | OK | GNU C++ | TESTS | 125 | 108 | 25600000 | 2500 | |
| 40982899 | ReaLNero1 | F | July 30, 2018, 6:37 p.m. | OK | GNU C++ | TESTS | 125 | 109 | 22937600 | 2500 | |
| 23392748 | munaiyi | F | Dec. 29, 2016, 8:11 a.m. | OK | GNU C++ | TESTS | 125 | 202 | 16179200 | 2500 | |
| 42273670 | luogu_bot5 | F | Aug. 30, 2018, 9:53 a.m. | OK | GNU C++ | TESTS | 125 | 217 | 14438400 | 2500 | |
| 28871217 | hohomu | F | July 25, 2017, 9:14 a.m. | OK | GNU C++ | TESTS | 125 | 234 | 18329600 | 2500 | |
| 25203061 | vjudge3 | F | March 4, 2017, 7:03 a.m. | OK | GNU C++ | TESTS | 125 | 248 | 17408000 | 2500 | |
| 23392341 | jasonvictoryan | F | Dec. 29, 2016, 7:43 a.m. | OK | GNU C++ | TESTS | 125 | 249 | 16179200 | 2500 | |
| 25203118 | vjudge3 | F | March 4, 2017, 7:06 a.m. | OK | GNU C++ | TESTS | 125 | 249 | 17408000 | 2500 | |
| 25362398 | vjudge2 | F | March 9, 2017, 2:35 p.m. | OK | GNU C++ | TESTS | 125 | 249 | 18227200 | 2500 | |
| 23348904 | Ali.Pi | F | Dec. 26, 2016, 9:31 p.m. | OK | GNU C++11 | TESTS | 125 | 109 | 24985600 | 2500 | |
| 57121608 | clya2004 | F | July 16, 2019, 1:35 a.m. | OK | GNU C++11 | TESTS | 125 | 155 | 13926400 | 2500 | |
| 57121585 | clya2004 | F | July 16, 2019, 1:33 a.m. | OK | GNU C++11 | TESTS | 125 | 156 | 16588800 | 2500 | |
| 29842278 | jefflyy | F | Aug. 28, 2017, 9:32 a.m. | OK | GNU C++11 | TESTS | 125 | 171 | 14540800 | 2500 | |
| 57877705 | lopare | F | July 28, 2019, 6:18 a.m. | OK | GNU C++11 | TESTS | 125 | 202 | 15564800 | 2500 | |
| 23678861 | Charles_Han | F | Jan. 10, 2017, 10:16 a.m. | OK | GNU C++11 | TESTS | 125 | 217 | 18432000 | 2500 | |
| 46743440 | frodakcin | F | Dec. 8, 2018, 5:17 a.m. | OK | GNU C++11 | TESTS | 125 | 217 | 59904000 | 2500 | |
| 49898822 | xielinhan | F | Feb. 14, 2019, 8:18 a.m. | OK | GNU C++11 | TESTS | 125 | 218 | 15360000 | 2500 | |
| 23333641 | Antandard | F | Dec. 26, 2016, 6:07 a.m. | OK | GNU C++11 | TESTS | 125 | 233 | 18227200 | 2500 | |
| 25216521 | vjudge5 | F | March 4, 2017, 2:19 p.m. | OK | GNU C++11 | TESTS | 125 | 249 | 18329600 | 2500 | |
| 23338645 | NiroBC | F | Dec. 26, 2016, 11:16 a.m. | OK | GNU C++14 | TESTS | 125 | 234 | 16793600 | 2500 | |
| 58213039 | MathAlex | F | Aug. 3, 2019, 9:32 a.m. | OK | GNU C++14 | TESTS | 125 | 264 | 15462400 | 2500 | |
| 66672059 | JioFell | F | Dec. 12, 2019, 9:46 a.m. | OK | GNU C++14 | TESTS | 125 | 264 | 16281600 | 2500 | |
| 25199929 | vjudge5 | F | March 4, 2017, 3:40 a.m. | OK | GNU C++14 | TESTS | 125 | 265 | 16793600 | 2500 | |
| 28386392 | please_delete_account | F | July 9, 2017, 11:29 a.m. | OK | GNU C++14 | TESTS | 125 | 265 | 18329600 | 2500 | |
| 61337105 | MiricaMatei | F | Sept. 26, 2019, 5:02 p.m. | OK | GNU C++14 | TESTS | 125 | 280 | 16486400 | 2500 | |
| 25177226 | Nanami_ChiaKi | F | March 3, 2017, 2:35 p.m. | OK | GNU C++14 | TESTS | 125 | 280 | 17612800 | 2500 | |
| 23353813 | Pi_Tigrannik vovanstrr | F | Dec. 27, 2016, 6:57 a.m. | OK | GNU C++14 | TESTS | 125 | 280 | 18124800 | 2500 | |
| 58537129 | Arg_007 | F | Aug. 10, 2019, 12:24 p.m. | OK | GNU C++14 | TESTS | 125 | 280 | 18841600 | 2500 | |
| 69526239 | NEZZ | F | Jan. 25, 2020, 3:10 p.m. | OK | GNU C++14 | TESTS | 125 | 280 | 19046400 | 2500 | |
| 51563059 | chinmay0906 | F | March 20, 2019, 8:41 a.m. | OK | GNU C++17 | TESTS | 125 | 265 | 17612800 | 2500 | |
| 41681425 | Tosic | F | Aug. 17, 2018, 11:14 a.m. | OK | GNU C++17 | TESTS | 125 | 280 | 16281600 | 2500 | |
| 51562544 | chinmay0906 | F | March 20, 2019, 8:30 a.m. | OK | GNU C++17 | TESTS | 125 | 280 | 19456000 | 2500 | |
| 37354631 | akaiNeko | F | April 15, 2018, 1:43 p.m. | OK | GNU C++17 | TESTS | 125 | 296 | 22630400 | 2500 | |
| 66773574 | Ali.Kh | F | Dec. 13, 2019, 9 a.m. | OK | GNU C++17 | TESTS | 125 | 296 | 35225600 | 2500 | |
| 65533549 | Phortox | F | Nov. 22, 2019, 1:20 p.m. | OK | GNU C++17 | TESTS | 125 | 311 | 20787200 | 2500 | |
| 44019076 | HappyEnd | F | Oct. 9, 2018, 1:49 a.m. | OK | GNU C++17 | TESTS | 125 | 311 | 21196800 | 2500 | |
| 55215662 | hugopm | F | June 6, 2019, 4:36 p.m. | OK | GNU C++17 | TESTS | 125 | 311 | 25804800 | 2500 | |
| 45986017 | Atreus | F | Nov. 20, 2018, 6:37 a.m. | OK | GNU C++17 | TESTS | 125 | 327 | 20684800 | 2500 | |
| 61759786 | Juve45 | F | Oct. 3, 2019, 6:44 a.m. | OK | GNU C++17 | TESTS | 125 | 342 | 21094400 | 2500 | |
| 23414325 | JialinOuyang | F | Dec. 30, 2016, 7:17 a.m. | OK | Java 8 | TESTS | 125 | 389 | 56934400 | 2500 | |
| 23397693 | IgorKoval | F | Dec. 29, 2016, 11:30 a.m. | OK | Java 8 | TESTS | 125 | 436 | 60518400 | 2500 | |
| 23397650 | IgorKoval | F | Dec. 29, 2016, 11:27 a.m. | OK | Java 8 | TESTS | 125 | 482 | 60620800 | 2500 | |
| 23397552 | IgorKoval | F | Dec. 29, 2016, 11:22 a.m. | OK | Java 8 | TESTS | 125 | 530 | 60518400 | 2500 | |
| 23367075 | tri | F | Dec. 27, 2016, 8:44 p.m. | OK | Java 8 | TESTS | 125 | 1169 | 170905600 | 2500 | |
| 28262205 | ze177482 | F | July 3, 2017, 6:07 p.m. | OK | MS C++ | TESTS | 125 | 763 | 16384000 | 2500 | |
| 28262139 | ze177482 | F | July 3, 2017, 6:03 p.m. | OK | MS C++ | TESTS | 125 | 764 | 16384000 | 2500 | |
| 23354824 | april1994 | F | Dec. 27, 2016, 8:02 a.m. | OK | MS C++ | TESTS | 125 | 1325 | 31744000 | 2500 |
Back to search problems