Codeforces Round 788 (Div. 2)

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
1670 Codeforces Round 788 (Div. 2) FINISHED False 7200 85418663 May 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1802 ) E Hemose on the Tree PROGRAMMING bitmasks constructive algorithms dfs and similar trees 2200

B'After the last regional contest, Hemose and his teammates finally qualified to the ICPC World Finals, so for this great achievement and his love of trees, he gave you this problem as the name of his team "Hemose 3al shagra" (Hemose on the tree). You are given a tree of n vertices where n is a power of 2 . You have to give each node and edge an integer value in the range [1,2n -1] (inclusive), where all the values are distinct. After giving each node and edge a value, you should select some root for the tree such that the maximum cost of any simple path starting from the root and ending at any node or edge is minimized. The cost of the path between two nodes u and v or any node u and edge e is defined as the bitwise XOR of all the node 's and edge 's values between them, including the endpoints (note that in a tree there is only one simple path between two nodes or between a node and an edge). The first line contains a single integer t ( 1 <= t <= 5 cdot 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains a single integer p ( 1 <= p <= 17 ), where n (the number of vertices in the tree) is equal to 2^p . Each of the next n xe2 x88 x921 lines contains two integers u and v ( 1 <= u,v <= n ) meaning that there is an edge between the vertices u and v in the tree. It is guaranteed that the given graph is a tree. It is guaranteed that the sum of n over all test cases doesn 't exceed 3 cdot 10^5 . For each test case on the first line print the chosen root. On the second line, print n integers separated by spaces, where the i -th integer represents the chosen value for the i -th node. On the third line, print n-1 integers separated by spaces, where the i -th integer represents the chosen value for the i -th edge. The edges are numerated in the order of their app'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
156112236 mban259 E May 6, 2022, 4 p.m. OK C# 8 TESTS 22 420 32972800 2200
156150397 chro4896 E May 7, 2022, 2:04 a.m. OK GNU C11 TESTS 22 607 15667200 2200
156151882 CQYZWJH E May 7, 2022, 2:37 a.m. OK GNU C++14 TESTS 22 93 7680000 2200
156119760 Aleph-zero E May 6, 2022, 4:28 p.m. OK GNU C++14 TESTS 22 155 24985600 2200
156154606 lmj_010308 E May 7, 2022, 3:32 a.m. OK GNU C++14 TESTS 22 156 7475200 2200
156152001 Irene E May 7, 2022, 2:39 a.m. OK GNU C++14 TESTS 22 170 25497600 2200
156152049 Irene E May 7, 2022, 2:40 a.m. OK GNU C++14 TESTS 22 170 25497600 2200
156152102 Irene E May 7, 2022, 2:41 a.m. OK GNU C++14 TESTS 22 171 7065600 2200
156109094 jumpmelon E May 6, 2022, 3:50 p.m. OK GNU C++14 TESTS 22 171 7168000 2200
156149476 rui_er E May 7, 2022, 1:41 a.m. OK GNU C++14 TESTS 22 171 7168000 2200
156147999 Eric_hooo E May 7, 2022, 12:59 a.m. OK GNU C++14 TESTS 22 171 8499200 2200
156155985 minsiqi E May 7, 2022, 4 a.m. OK GNU C++14 TESTS 22 171 9728000 2200
156110732 zundamochi_1117 E May 6, 2022, 3:55 p.m. OK GNU C++17 TESTS 22 170 7475200 2200
156155806 lddlinan E May 7, 2022, 3:57 a.m. OK GNU C++17 TESTS 22 171 6144000 2200
156111308 Satoko E May 6, 2022, 3:57 p.m. OK GNU C++17 TESTS 22 171 7065600 2200
156161814 sugmedic E May 7, 2022, 5:45 a.m. OK GNU C++17 TESTS 22 171 7065600 2200
156109869 qjatn0120 E May 6, 2022, 3:53 p.m. OK GNU C++17 TESTS 22 171 7270400 2200
156146287 _LeMur_ E May 6, 2022, 11:56 p.m. OK GNU C++17 TESTS 22 171 8499200 2200
156112275 krit3379 E May 6, 2022, 4 p.m. OK GNU C++17 TESTS 22 171 8499200 2200
156156811 Normie28 E May 7, 2022, 4:18 a.m. OK GNU C++17 TESTS 22 171 8499200 2200
156123887 fallleaves07 E May 6, 2022, 5:24 p.m. OK GNU C++17 TESTS 22 171 10444800 2200
156127351 Moon_Quakes E May 6, 2022, 5:50 p.m. OK GNU C++17 TESTS 22 171 11673600 2200
156129606 propane E May 6, 2022, 6:13 p.m. OK GNU C++17 (64) TESTS 22 124 8089600 2200
156155825 xiece666 E May 7, 2022, 3:57 a.m. OK GNU C++17 (64) TESTS 22 124 10854400 2200
156151724 XHYU61 E May 7, 2022, 2:34 a.m. OK GNU C++17 (64) TESTS 22 124 11673600 2200
156151536 Zhongli61 E May 7, 2022, 2:30 a.m. OK GNU C++17 (64) TESTS 22 124 11673600 2200
156157283 ikefumy E May 7, 2022, 4:27 a.m. OK GNU C++17 (64) TESTS 22 139 10137600 2200
156145475 skittles1412 E May 6, 2022, 11:24 p.m. OK GNU C++17 (64) TESTS 22 140 10137600 2200
156162580 Lucina E May 7, 2022, 5:57 a.m. OK GNU C++17 (64) TESTS 22 155 13004800 2200
156117149 blank_monster E May 6, 2022, 4:18 p.m. OK GNU C++17 (64) TESTS 22 155 14643200 2200
156127226 illyakr E May 6, 2022, 5:49 p.m. OK GNU C++17 (64) TESTS 22 155 20787200 2200
156135891 kessido E May 6, 2022, 7:33 p.m. OK GNU C++17 (64) TESTS 22 170 9932800 2200
156159882 Rinors E May 7, 2022, 5:15 a.m. OK GNU C++20 (64) TESTS 22 93 5529600 2200
156117038 liouzhou_101 E May 6, 2022, 4:17 p.m. OK GNU C++20 (64) TESTS 22 93 10342400 2200
156157621 Bsqaq E May 7, 2022, 4:34 a.m. OK GNU C++20 (64) TESTS 22 93 11776000 2200
156156402 Roll_Num_56 E May 7, 2022, 4:09 a.m. OK GNU C++20 (64) TESTS 22 108 12390400 2200
156153829 Lavine E May 7, 2022, 3:17 a.m. OK GNU C++20 (64) TESTS 22 124 8294400 2200
156145688 ruhan.habib39 E May 6, 2022, 11:33 p.m. OK GNU C++20 (64) TESTS 22 124 9113600 2200
156124194 kasparovian E May 6, 2022, 5:25 p.m. OK GNU C++20 (64) TESTS 22 124 9625600 2200
156129173 Allvik06 E May 6, 2022, 6:09 p.m. OK GNU C++20 (64) TESTS 22 124 12390400 2200
156143335 V4V E May 6, 2022, 10:02 p.m. OK GNU C++20 (64) TESTS 22 124 12390400 2200
156133434 vodacbaoan E May 6, 2022, 6:59 p.m. OK GNU C++20 (64) TESTS 22 124 13004800 2200
156145403 henrychenOutlook E May 6, 2022, 11:21 p.m. OK Java 11 TESTS 22 561 28876800 2200
156112748 MagentaCobra E May 6, 2022, 4:02 p.m. OK Java 8 TESTS 22 420 34918400 2200
156148651 Abdallah_Ragab00 E May 7, 2022, 1:17 a.m. OK Java 8 TESTS 22 889 31232000 2200
156150294 YMSeah E May 7, 2022, 2:01 a.m. OK PyPy 3 TESTS 22 592 29491200 2200
156153407 ruimina E May 7, 2022, 3:08 a.m. OK PyPy 3 TESTS 22 608 43724800 2200
156157157 NecroSean38 E May 7, 2022, 4:24 a.m. OK PyPy 3 TESTS 22 623 46899200 2200
156125399 hxu10 E May 6, 2022, 5:33 p.m. OK PyPy 3 TESTS 22 795 49356800 2200
156111003 misorin E May 6, 2022, 3:56 p.m. OK PyPy 3 TESTS 22 826 50483200 2200
156137936 random__person E May 6, 2022, 8:06 p.m. OK PyPy 3 TESTS 22 919 82432000 2200
156117382 undertaker271 E May 6, 2022, 4:19 p.m. OK PyPy 3 TESTS 22 982 131481600 2200
156110675 CAELO E May 6, 2022, 3:55 p.m. OK PyPy 3 TESTS 22 1014 34611200 2200
156129353 madun1999 E May 6, 2022, 6:11 p.m. OK PyPy 3 TESTS 22 1154 67072000 2200
156115795 taiga0629 E May 6, 2022, 4:13 p.m. OK PyPy 3 TESTS 22 1232 57446400 2200
156110770 siganai E May 6, 2022, 3:55 p.m. OK PyPy 3-64 TESTS 22 982 72089600 2200
156114699 plevande E May 6, 2022, 4:09 p.m. OK PyPy 3-64 TESTS 22 998 80281600 2200
156150623 coconut99 E May 7, 2022, 2:09 a.m. OK PyPy 3-64 TESTS 22 1434 86323200 2200
156120940 dyppp E May 6, 2022, 4:32 p.m. OK PyPy 3-64 TESTS 22 1481 85913600 2200
156110676 Jimanbanashi E May 6, 2022, 3:55 p.m. OK Python 2 TESTS 22 1013 24473600 2200
156159102 anishde85 E May 7, 2022, 5:02 a.m. OK Python 3 TESTS 22 1653 191692800 2200

remove filters

Back to search problems