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 |
|---|---|---|---|---|---|---|
| 566 | VK Cup 2015 - Finals, online mirror | FINISHED | False | 10800 | 338132423 | July 30, 2015, 4:20 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 881 ) | C | Logistical Questions | PROGRAMMING | dfs and similar divide and conquer trees | 3000 |
Some country consists of n cities, connected by a railroad network. The transport communication of the country is so advanced that the network consists of a minimum required number of ( n - 1) bidirectional roads (in the other words, the graph of roads is a tree). The i -th road that directly connects cities a i and b i , has the length of l i kilometers. The transport network is served by a state transporting company FRR (Fabulous Rail Roads). In order to simplify the price policy, it offers a single ride fare on the train. In order to follow the route of length t kilometers, you need to pay burles. Note that it is forbidden to split a long route into short segments and pay them separately (a special railroad police, or RRP, controls that the law doesn't get violated). A Large Software Company decided to organize a programming tournament. Having conducted several online rounds, the company employees determined a list of finalists and sent it to the logistical department to find a place where to conduct finals. The Large Software Company can easily organize the tournament finals in any of the n cities of the country, so the the main factor in choosing the city for the last stage of the tournament is the total cost of buying tickets for all the finalists. We know that the i -th city of the country has w i cup finalists living there. Help the company employees find the city such that the total cost of travel of all the participants to it is minimum. The first line of the input contains number n ( 1 ≤ n ≤ 200 000 ) — the number of cities in the country. The next line contains n integers w 1 , w 2 , ..., w n ( 0 ≤ w i ≤ 10 8 ) — the number of finalists living in each city of the country. Next ( n - 1) lines contain the descriptions of the railroad, the i -th line contains three integers, a i , b i , l i ( 1 ≤ a i , b i ≤ n , a i ≠ b i , 1 ≤ l i ≤ 1000 ). Print two numbers — an integer f that is the number of the optimal city to conduct the competition, and the |
| Editorial for VK Cup 2015 — Finals |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 27979568 | jiyutian | C | June 23, 2017, 7:44 a.m. | OK | GNU C++ | TESTS | 43 | 171 | 28364800 | 3000 | |
| 28635166 | progg_admin | C | July 17, 2017, 9:30 a.m. | OK | GNU C++ | TESTS | 43 | 171 | 28569600 | 3000 | |
| 27880169 | vjudge1 | C | June 18, 2017, 8:32 a.m. | OK | GNU C++ | TESTS | 43 | 171 | 115404800 | 3000 | |
| 40986335 | ReaLNero1 | C | July 30, 2018, 8:29 p.m. | OK | GNU C++ | TESTS | 43 | 186 | 115404800 | 3000 | |
| 27979782 | jiyutian | C | June 23, 2017, 7:57 a.m. | OK | GNU C++ | TESTS | 43 | 187 | 28364800 | 3000 | |
| 27880187 | vjudge5 | C | June 18, 2017, 8:32 a.m. | OK | GNU C++ | TESTS | 43 | 187 | 115404800 | 3000 | |
| 27997986 | zhan8855 | C | June 24, 2017, 5:49 a.m. | OK | GNU C++ | TESTS | 43 | 187 | 117452800 | 3000 | |
| 29584946 | laofudasuan | C | Aug. 19, 2017, 1:31 a.m. | OK | GNU C++ | TESTS | 43 | 202 | 14643200 | 3000 | |
| 13887024 | 130705009 | C | Oct. 27, 2015, 8:19 a.m. | OK | GNU C++ | TESTS | 43 | 234 | 25600000 | 3000 | |
| 12285091 | KFDong | C | July 31, 2015, 2:11 a.m. | OK | GNU C++ | TESTS | 43 | 234 | 25600000 | 3000 | |
| 65688428 | cly_none | C | Nov. 25, 2019, 2:37 a.m. | OK | GNU C++11 | TESTS | 43 | 93 | 23244800 | 3000 | |
| 68060639 | luogu_bot5 | C | Jan. 2, 2020, 3:31 a.m. | OK | GNU C++11 | TESTS | 43 | 109 | 25804800 | 3000 | |
| 68060451 | x_faraway_x | C | Jan. 2, 2020, 3:18 a.m. | OK | GNU C++11 | TESTS | 43 | 124 | 25804800 | 3000 | |
| 41288704 | newbiegcz | C | Aug. 6, 2018, 11:53 p.m. | OK | GNU C++11 | TESTS | 43 | 140 | 22220800 | 3000 | |
| 68961679 | Backseat-Stargazer | C | Jan. 17, 2020, 1:32 a.m. | OK | GNU C++11 | TESTS | 43 | 155 | 23449600 | 3000 | |
| 12296567 | krijgertje | C | July 31, 2015, 9:31 p.m. | OK | GNU C++11 | TESTS | 43 | 156 | 10649600 | 3000 | |
| 68703743 | mrsrz | C | Jan. 13, 2020, 10:25 a.m. | OK | GNU C++11 | TESTS | 43 | 156 | 20787200 | 3000 | |
| 41288717 | newbiegcz | C | Aug. 6, 2018, 11:55 p.m. | OK | GNU C++11 | TESTS | 43 | 156 | 22220800 | 3000 | |
| 65687404 | cjy2003 | C | Nov. 25, 2019, 1:32 a.m. | OK | GNU C++11 | TESTS | 43 | 171 | 23654400 | 3000 | |
| 63969669 | hychyc | C | Nov. 1, 2019, 8:37 a.m. | OK | GNU C++11 | TESTS | 43 | 187 | 24473600 | 3000 | |
| 57844785 | SuperFF | C | July 27, 2019, 10:38 a.m. | OK | GNU C++14 | TESTS | 43 | 77 | 19148800 | 3000 | |
| 64097463 | Created_equal | C | Nov. 2, 2019, 2:20 p.m. | OK | GNU C++14 | TESTS | 43 | 156 | 31641600 | 3000 | |
| 63363160 | zsyzsy | C | Oct. 25, 2019, 6:30 a.m. | OK | GNU C++14 | TESTS | 43 | 233 | 24985600 | 3000 | |
| 67607089 | nealchen | C | Dec. 25, 2019, 2 p.m. | OK | GNU C++14 | TESTS | 43 | 264 | 17715200 | 3000 | |
| 67988846 | 251 | C | Dec. 31, 2019, 2:29 a.m. | OK | GNU C++14 | TESTS | 43 | 280 | 24985600 | 3000 | |
| 68871691 | PinkRabbit | C | Jan. 15, 2020, 3:26 p.m. | OK | GNU C++14 | TESTS | 43 | 280 | 28160000 | 3000 | |
| 38706217 | qiqi20021026 | C | May 29, 2018, midnight | OK | GNU C++14 | TESTS | 43 | 280 | 40857600 | 3000 | |
| 63967111 | emoairx | C | Nov. 1, 2019, 7:38 a.m. | OK | GNU C++14 | TESTS | 43 | 295 | 13824000 | 3000 | |
| 69733208 | apiadu | C | Jan. 29, 2020, 1:59 p.m. | OK | GNU C++14 | TESTS | 43 | 296 | 34099200 | 3000 | |
| 63692352 | Rubbish12345 | C | Oct. 29, 2019, 3:29 a.m. | OK | GNU C++14 | TESTS | 43 | 311 | 22220800 | 3000 | |
| 52221875 | Trisolaris | C | April 2, 2019, 7:06 a.m. | OK | GNU C++17 | TESTS | 43 | 108 | 18534400 | 3000 | |
| 63633753 | CMXRYNP | C | Oct. 28, 2019, 7:23 a.m. | OK | GNU C++17 | TESTS | 43 | 202 | 21811200 | 3000 | |
| 65565781 | ruo | C | Nov. 23, 2019, 5:48 a.m. | OK | GNU C++17 | TESTS | 43 | 249 | 22016000 | 3000 | |
| 63771619 | Elegia | C | Oct. 30, 2019, 8:11 a.m. | OK | GNU C++17 | TESTS | 43 | 249 | 24371200 | 3000 | |
| 69733640 | vjudge4 | C | Jan. 29, 2020, 2:05 p.m. | OK | GNU C++17 | TESTS | 43 | 295 | 24371200 | 3000 | |
| 47442858 | ddpag | C | Dec. 24, 2018, 3:34 a.m. | OK | GNU C++17 | TESTS | 43 | 296 | 17305600 | 3000 | |
| 48910269 | tfg | C | Jan. 25, 2019, 1:32 a.m. | OK | GNU C++17 | TESTS | 43 | 296 | 28979200 | 3000 | |
| 59970329 | saketh | C | Sept. 4, 2019, 12:24 a.m. | OK | GNU C++17 | TESTS | 43 | 343 | 35430400 | 3000 | |
| 65795039 | HirasawaaYui | C | Nov. 27, 2019, 3:42 a.m. | OK | GNU C++17 | TESTS | 43 | 390 | 17817600 | 3000 | |
| 68710409 | xymtxdy | C | Jan. 13, 2020, 12:48 p.m. | OK | GNU C++17 | TESTS | 43 | 467 | 36352000 | 3000 | |
| 14041912 | SlavaSSU | C | Nov. 3, 2015, 1:08 p.m. | OK | Java 7 | TESTS | 43 | 1247 | 151552000 | 3000 | |
| 12330961 | IgorKoval | C | Aug. 3, 2015, 9:28 p.m. | OK | Java 8 | TESTS | 43 | 685 | 71680000 | 3000 | |
| 12331058 | IgorKoval | C | Aug. 3, 2015, 9:52 p.m. | OK | Java 8 | TESTS | 43 | 685 | 71782400 | 3000 | |
| 12291561 | qwerty787788 | C | July 31, 2015, 12:39 p.m. | OK | Java 8 | TESTS | 43 | 717 | 59289600 | 3000 | |
| 12330960 | IgorKoval | C | Aug. 3, 2015, 9:28 p.m. | OK | Java 8 | TESTS | 43 | 717 | 71680000 | 3000 | |
| 12330954 | IgorKoval | C | Aug. 3, 2015, 9:26 p.m. | OK | Java 8 | TESTS | 43 | 1013 | 71782400 | 3000 | |
| 48699497 | tri | C | Jan. 22, 2019, 1:45 a.m. | OK | Java 8 | TESTS | 43 | 1060 | 74752000 | 3000 | |
| 12291783 | qwerty787788 | C | July 31, 2015, 12:57 p.m. | OK | Java 8 | TESTS | 43 | 1278 | 164761600 | 3000 | |
| 12291657 | qwerty787788 | C | July 31, 2015, 12:47 p.m. | OK | Java 8 | TESTS | 43 | 1278 | 164761600 | 3000 | |
| 14041915 | SlavaSSU | C | Nov. 3, 2015, 1:09 p.m. | OK | Java 8 | TESTS | 43 | 1325 | 151244800 | 3000 | |
| 12331061 | IgorKoval | C | Aug. 3, 2015, 9:53 p.m. | OK | Java 8 | TESTS | 43 | 1372 | 71680000 | 3000 |
Back to search problems