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 |
---|---|---|---|---|---|---|
1396 | Codeforces Round 666 (Div. 1) | FINISHED | False | 7200 | 138554711 | Aug. 30, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 356 ) | E | Distance Matching | PROGRAMMING | binary search constructive algorithms dfs and similar trees |
B'You are given an integer k and a tree T with n nodes ( n is even). Let dist(u, v) be the number of edges on the shortest path from node u to node v in T . Let us define a undirected weighted complete graph G = (V, E) as following: Your task is simple, find a perfect matching in G with total edge weight k (1 <= k <= n^2) . The first line of input contains two integers n , k ( 2 <= n <= 100 ,000 , n is even, 1 <= k <= n^2 ): number of nodes and the total edge weight of the perfect matching you need to find. The i -th of the following n - 1 lines contains two integers v_i , u_i ( 1 <= v_i, u_i <= n ) denoting an edge between v_i and u_i in T . It is guaranteed that the given graph is a tree. If there are no matchings that satisfy the above condition, output "NO" (without quotes) on a single line. Otherwise, you should output "YES" (without quotes) on the first line of output. You should then output frac{n}{2} lines, the i -th line containing p_i, q_i ( 1 <= p_i, q_i <= n ): the i -th pair of the matching. A tree is a connected acyclic undirected graph. A matching is set of pairwise non-adjacent edges, none of which are loops; that is, no two edges share a common vertex. A perfect matching is a matching which matches all vertices of the graph; that is, every vertex of the graph is incident to exactly one edge of the matching. '... |
Codeforces Round #666 — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
91675902 | rainboy | E | Sept. 2, 2020, 9:47 p.m. | OK | GNU C11 | TESTS | 76 | 265 | 13107200 | ||
91434326 | rainboy | E | Aug. 30, 2020, 7:21 p.m. | OK | GNU C11 | TESTS | 76 | 373 | 16076800 | ||
91423865 | rainboy | E | Aug. 30, 2020, 5:49 p.m. | OK | GNU C11 | TESTS | 76 | 374 | 16486400 | ||
91568473 | 2018LZY | E | Sept. 1, 2020, 1:18 p.m. | OK | GNU C++11 | TESTS | 76 | 93 | 11776000 | ||
91567480 | 2018LZY | E | Sept. 1, 2020, 1:06 p.m. | OK | GNU C++11 | TESTS | 76 | 93 | 11776000 | ||
91528986 | luogu_bot4 | E | Sept. 1, 2020, 12:40 a.m. | OK | GNU C++11 | TESTS | 76 | 108 | 21504000 | ||
91561335 | xryjr233 | E | Sept. 1, 2020, 11:41 a.m. | OK | GNU C++11 | TESTS | 76 | 109 | 11878400 | ||
91529118 | luogu_bot4 | E | Sept. 1, 2020, 12:47 a.m. | OK | GNU C++11 | TESTS | 76 | 109 | 21504000 | ||
91563848 | Scarlet_Hypoc | E | Sept. 1, 2020, 12:16 p.m. | OK | GNU C++11 | TESTS | 76 | 124 | 12185600 | ||
91616332 | RainAir | E | Sept. 2, 2020, 6:18 a.m. | OK | GNU C++11 | TESTS | 76 | 124 | 12492800 | ||
91547402 | Scarlet_Hypoc | E | Sept. 1, 2020, 8:08 a.m. | OK | GNU C++11 | TESTS | 76 | 140 | 12595200 | ||
91646662 | Small_Account | E | Sept. 2, 2020, 1:55 p.m. | OK | GNU C++11 | TESTS | 76 | 155 | 17100800 | ||
91507350 | BigBag | E | Aug. 31, 2020, 4:01 p.m. | OK | GNU C++11 | TESTS | 76 | 155 | 26521600 | ||
91436516 | consecutivelimit | E | Aug. 30, 2020, 7:53 p.m. | OK | GNU C++14 | TESTS | 76 | 109 | 21094400 | ||
91586459 | manohar24 | E | Sept. 1, 2020, 4:56 p.m. | OK | GNU C++14 | TESTS | 76 | 140 | 12902400 | ||
91434850 | clyring | E | Aug. 30, 2020, 7:28 p.m. | OK | GNU C++14 | TESTS | 76 | 140 | 13209600 | ||
91545222 | beginend | E | Sept. 1, 2020, 7:34 a.m. | OK | GNU C++14 | TESTS | 76 | 140 | 15769600 | ||
91536111 | ZZZZZZZZZZZZZZZZZZ | E | Sept. 1, 2020, 4:50 a.m. | OK | GNU C++14 | TESTS | 76 | 140 | 18329600 | ||
91414724 | yhx-12243 | E | Aug. 30, 2020, 4:25 p.m. | OK | GNU C++14 | TESTS | 76 | 171 | 25088000 | ||
91598737 | danya090699 | E | Sept. 1, 2020, 8:39 p.m. | OK | GNU C++14 | TESTS | 76 | 186 | 22323200 | ||
91685524 | marcOS | E | Sept. 3, 2020, 4:04 a.m. | OK | GNU C++14 | TESTS | 76 | 187 | 24166400 | ||
91705040 | pantw | E | Sept. 3, 2020, 9:41 a.m. | OK | GNU C++14 | TESTS | 76 | 187 | 27443200 | ||
91638936 | oipotato | E | Sept. 2, 2020, 12:12 p.m. | OK | GNU C++14 | TESTS | 76 | 217 | 17408000 | ||
91675911 | rainboy | E | Sept. 2, 2020, 9:48 p.m. | OK | GNU C++17 | TESTS | 76 | 93 | 13004800 | ||
91434347 | rainboy | E | Aug. 30, 2020, 7:21 p.m. | OK | GNU C++17 | TESTS | 76 | 93 | 16076800 | ||
91600903 | krijgertje | E | Sept. 1, 2020, 9:55 p.m. | OK | GNU C++17 | TESTS | 76 | 124 | 13209600 | ||
91498383 | timf1089 | E | Aug. 31, 2020, 2:12 p.m. | OK | GNU C++17 | TESTS | 76 | 124 | 13312000 | ||
91437218 | Shayan.P | E | Aug. 30, 2020, 8:04 p.m. | OK | GNU C++17 | TESTS | 76 | 140 | 17100800 | ||
91682354 | gongsuidashen | E | Sept. 3, 2020, 2:29 a.m. | OK | GNU C++17 | TESTS | 76 | 155 | 17920000 | ||
91436471 | Medeowex | E | Aug. 30, 2020, 7:52 p.m. | OK | GNU C++17 | TESTS | 76 | 155 | 21196800 | ||
91463189 | jiangly | E | Aug. 31, 2020, 6:26 a.m. | OK | GNU C++17 | TESTS | 76 | 155 | 24780800 | ||
91514852 | ganbaranai | E | Aug. 31, 2020, 5:45 p.m. | OK | GNU C++17 | TESTS | 76 | 171 | 19148800 | ||
91705820 | pantw | E | Sept. 3, 2020, 9:53 a.m. | OK | GNU C++17 | TESTS | 76 | 171 | 27443200 | ||
91572764 | fivefourthreeone | E | Sept. 1, 2020, 2:13 p.m. | OK | GNU C++17 (64) | TESTS | 76 | 109 | 21913600 | ||
91486208 | ikovrigin | E | Aug. 31, 2020, 11:35 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 109 | 28057600 | ||
91485045 | ikovrigin | E | Aug. 31, 2020, 11:18 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 109 | 29593600 | ||
91486551 | ikovrigin | E | Aug. 31, 2020, 11:40 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 124 | 25190400 | ||
91486312 | ikovrigin | E | Aug. 31, 2020, 11:36 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 124 | 28057600 | ||
91441444 | ecnerwala | E | Aug. 30, 2020, 9:48 p.m. | OK | GNU C++17 (64) | TESTS | 76 | 124 | 29593600 | ||
91484041 | ikovrigin | E | Aug. 31, 2020, 11:04 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 124 | 29593600 | ||
91446470 | Marckess | E | Aug. 31, 2020, 1:22 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 139 | 33484800 | ||
91484769 | ikovrigin | E | Aug. 31, 2020, 11:14 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 139 | 38400000 | ||
91485254 | ikovrigin | E | Aug. 31, 2020, 11:21 a.m. | OK | GNU C++17 (64) | TESTS | 76 | 140 | 29593600 |
Back to search problems