CodeTON Round 1 (Div. 1 + Div. 2, Rated, Prizes!)

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
1656 CodeTON Round 1 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 7200 89047463 March 24, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3542 ) E Equal Tree Sums PROGRAMMING constructive algorithms dfs and similar trees

B'You are given an undirected unrooted tree, i.e. a connected undirected graph without cycles. You must assign a nonzero integer weight to each vertex so that the following is satisfied: if any vertex of the tree is removed, then each of the remaining connected components has the same sum of weights in its vertices. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains an integer n ( 3 <= q n <= q 10^5 ) -- the number of vertices of the tree. The next n-1 lines of each case contain each two integers u, v ( 1 <= q u,v <= q n ) denoting that there is an edge between vertices u and v . It is guaranteed that the given edges form a tree. The sum of n for all test cases is at most 10^5 . For each test case, you must output one line with n space separated integers a_1, a_2, ldots, a_n , where a_i is the weight assigned to vertex i . The weights must satisfy -10^5 <= q a_i <= q 10^5 and a_i neq 0 . It can be shown that there always exists a solution satisfying these constraints. If there are multiple possible solutions, output any of them. In the first case, when removing vertex 1 all remaining connected components have sum 5 and when removing vertex 3 all remaining connected components have sum 2 . When removing other vertices, there is only one remaining connected component so all remaining connected components have the same sum. '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
150800917 taering E March 24, 2022, 4:29 p.m. OK FPC TESTS 17 374 18022400
150853990 yqj_1234 E March 25, 2022, 5:59 a.m. OK GNU C++14 TESTS 18 30 8806400
150850170 win10 E March 25, 2022, 5:06 a.m. OK GNU C++14 TESTS 18 31 6656000
150842895 hokarikanae E March 25, 2022, 2:50 a.m. OK GNU C++14 TESTS 18 46 3788800
150846209 hefengchen E March 25, 2022, 3:58 a.m. OK GNU C++14 TESTS 18 46 4403200
150839416 wsyhb E March 25, 2022, 1:27 a.m. OK GNU C++14 TESTS 18 46 4812800
150836332 L7-56 E March 25, 2022, 12:02 a.m. OK GNU C++14 TESTS 18 46 5836800
150839565 zyl19416 E March 25, 2022, 1:31 a.m. OK GNU C++14 TESTS 18 46 6246400
150838015 Tyyyyyy E March 25, 2022, 12:50 a.m. OK GNU C++14 TESTS 18 61 5836800
150842528 Commonrain E March 25, 2022, 2:42 a.m. OK GNU C++14 TESTS 18 61 8704000
150844145 1884613kjh E March 25, 2022, 3:16 a.m. OK GNU C++14 TESTS 18 62 5836800
150836981 KanadeChin E March 25, 2022, 12:21 a.m. OK GNU C++17 TESTS 18 46 3481600
150844390 xjq E March 25, 2022, 3:21 a.m. OK GNU C++17 TESTS 18 46 5222400
150851633 andiiiiiiiii E March 25, 2022, 5:28 a.m. OK GNU C++17 TESTS 18 61 4812800
150850082 dargoncat E March 25, 2022, 5:05 a.m. OK GNU C++17 TESTS 18 61 5836800
150851389 wwawwaww E March 25, 2022, 5:24 a.m. OK GNU C++17 TESTS 18 61 8499200
150811593 maksiun E March 24, 2022, 5:36 p.m. OK GNU C++17 TESTS 18 62 4812800
150810599 sangram03 E March 24, 2022, 5:30 p.m. OK GNU C++17 TESTS 17 62 5222400
150836902 euoao E March 25, 2022, 12:19 a.m. OK GNU C++17 TESTS 18 62 5427200
150804709 rolling E March 24, 2022, 4:34 p.m. OK GNU C++17 TESTS 17 62 5836800
150839577 Spitfire_F_Mk_IX E March 25, 2022, 1:32 a.m. OK GNU C++17 TESTS 18 62 6246400
150843860 wcdr E March 25, 2022, 3:10 a.m. OK GNU C++17 (64) TESTS 18 31 10752000
150845755 Qingyu E March 25, 2022, 3:49 a.m. OK GNU C++17 (64) TESTS 18 31 13721600
150842671 Tsjizjow E March 25, 2022, 2:45 a.m. OK GNU C++17 (64) TESTS 18 61 9523200
150835975 basic_string E March 24, 2022, 11:50 p.m. OK GNU C++17 (64) TESTS 18 61 10137600
150799866 Mitsubachi E March 24, 2022, 4:28 p.m. OK GNU C++17 (64) TESTS 17 61 13619200
150804272 ljcleo E March 24, 2022, 4:34 p.m. OK GNU C++17 (64) TESTS 17 61 14745600
150812026 mysteri0us7 E March 24, 2022, 5:39 p.m. OK GNU C++17 (64) TESTS 18 62 6451200
150845636 gqf123 E March 25, 2022, 3:46 a.m. OK GNU C++17 (64) TESTS 18 62 9523200
150845379 fishcathu. E March 25, 2022, 3:41 a.m. OK GNU C++17 (64) TESTS 18 62 9523200
150839584 leexzq E March 25, 2022, 1:32 a.m. OK GNU C++17 (64) TESTS 18 62 9523200
150845910 Grey_Crane_Is_Here E March 25, 2022, 3:53 a.m. OK GNU C++20 (64) TESTS 18 46 6144000
150821265 Olympia E March 24, 2022, 6:59 p.m. OK GNU C++20 (64) TESTS 18 46 6246400
150810136 physics0523 E March 24, 2022, 5:27 p.m. OK GNU C++20 (64) TESTS 17 46 6246400
150845066 End_the_rew E March 25, 2022, 3:35 a.m. OK GNU C++20 (64) TESTS 18 46 6451200
150836546 dcclyde E March 25, 2022, 12:09 a.m. OK GNU C++20 (64) TESTS 18 46 6451200
150842478 bzkk E March 25, 2022, 2:41 a.m. OK GNU C++20 (64) TESTS 18 46 6553600
150808981 oToToT E March 24, 2022, 5:21 p.m. OK GNU C++20 (64) TESTS 17 46 6860800
150816787 ParthDwivedi E March 24, 2022, 6:16 p.m. OK GNU C++20 (64) TESTS 18 46 7372800
150836679 Rinors E March 25, 2022, 12:13 a.m. OK GNU C++20 (64) TESTS 18 46 7577600
150853309 wjmsxbd E March 25, 2022, 5:51 a.m. OK GNU C++20 (64) TESTS 18 46 8294400
150852291 eshan18.09 E March 25, 2022, 5:37 a.m. OK Java 11 TESTS 18 405 19251200
150821873 Restricted E March 24, 2022, 7:05 p.m. OK Java 11 TESTS 18 436 47104000
150844117 __Serendipity E March 25, 2022, 3:16 a.m. OK Java 11 TESTS 18 467 24678400
150815817 SecondThread E March 24, 2022, 6:08 p.m. OK Java 8 TESTS 18 265 79974400
150815920 YahiaSherif E March 24, 2022, 6:08 p.m. OK Java 8 TESTS 18 311 15872000
150827440 ak_ankit E March 24, 2022, 8:18 p.m. OK Java 8 TESTS 18 311 22323200
150820289 AS_1729 E March 24, 2022, 6:49 p.m. OK Java 8 TESTS 18 623 80793600
150840301 cc4414 E March 25, 2022, 1:50 a.m. OK Java 8 TESTS 18 701 53760000
150803419 NecroSean38 E March 24, 2022, 4:33 p.m. OK PyPy 3 TESTS 17 296 24576000
150807218 titia E March 24, 2022, 5:12 p.m. OK PyPy 3 TESTS 17 420 24166400
150827576 bpdolson E March 24, 2022, 8:20 p.m. OK PyPy 3-64 TESTS 18 295 31641600
150823147 asdsasd E March 24, 2022, 7:20 p.m. OK PyPy 3-64 TESTS 18 358 31744000
150831951 Skillful_Wanderer E March 24, 2022, 9:50 p.m. OK PyPy 3-64 TESTS 18 374 32460800
150809957 Igrmi E March 24, 2022, 5:26 p.m. OK PyPy 3-64 TESTS 17 436 30924800
150828659 oadey89 E March 24, 2022, 8:39 p.m. OK PyPy 3-64 TESTS 18 452 55705600
150850979 zouyu9631 E March 25, 2022, 5:18 a.m. OK PyPy 3-64 TESTS 18 545 41062400
150799881 huikang E March 24, 2022, 4:28 p.m. OK PyPy 3-64 TESTS 17 717 90828800
150808421 rusanyan E March 24, 2022, 5:17 p.m. OK PyPy 3-64 TESTS 17 982 32870400
150808435 ulyss E March 24, 2022, 5:18 p.m. OK Python 3 TESTS 17 498 116121600
150851247 coder_sounak E March 25, 2022, 5:22 a.m. OK Python 3 TESTS 18 592 139264000
150814219 Spheniscine E March 24, 2022, 5:54 p.m. OK Rust 2021 TESTS 18 46 11673600
150817542 46hinat E March 24, 2022, 6:22 p.m. OK Rust 2021 TESTS 18 78 16076800
150840321 clause E March 25, 2022, 1:50 a.m. OK Rust 2021 TESTS 18 109 20889600

remove filters

Back to search problems