Codeforces Round 914 (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
1904 Codeforces Round 914 (Div. 2) FINISHED False 7200 35042063 Dec. 9, 2023, 4:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 394 ) F Beautiful Tree PROGRAMMING data structures dfs and similar graphs trees

B'Lunchbox has a tree of size n rooted at node 1 . Each node is then assigned a value. Lunchbox considers the tree to be beautiful if each value is distinct and ranges from 1 to n . In addition, a beautiful tree must also satisfy m requirements of 2 types: Now, you must assign values to each node such that the resulting tree is beautiful. If it is impossible to do so, output -1 . The first line contains two integers n and m ( 2 <= n, m <= 2 cdot 10^5 ). The next n - 1 lines contain two integers u and v ( 1 <= u, v <= n, u ne v ) -- denoting an edge between nodes u and v . It is guaranteed that the given edges form a tree. The next m lines each contain four integers t , a , b , and c ( t in {1,2 } , 1 <= a, b, c <= n ). It is guaranteed that node c is on the path between nodes a and b . If it is impossible to assign values such that the tree is beautiful, output -1 . Otherwise, output n integers, the i -th of which denotes the value of node i . '...

Tutorials

Codeforces Round 914 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
236586860 happy.potato F Dec. 9, 2023, 8:25 p.m. OK GNU C++17 TESTS 75 1263 93900800
236607693 SRIRAGAVI F Dec. 10, 2023, 3:46 a.m. OK GNU C++17 TESTS 75 1310 93081600
236603336 Swishy123 F Dec. 10, 2023, 2:09 a.m. OK GNU C++17 TESTS 75 3244 100864000
236603313 ultimateboner F Dec. 10, 2023, 2:09 a.m. OK GNU C++17 TESTS 75 3244 100864000
236563688 MridulAhi F Dec. 9, 2023, 5:44 p.m. OK GNU C++17 TESTS 75 3368 367001600
236574373 AmirAli-Asgari F Dec. 9, 2023, 6:24 p.m. OK GNU C++17 TESTS 75 3603 432947200
236602215 Alfred7 F Dec. 10, 2023, 1:37 a.m. OK GNU C++17 TESTS 75 3712 79769600
236572745 Alpha_Q F Dec. 9, 2023, 6:17 p.m. OK GNU C++17 TESTS 75 3805 79769600
236572769 SmolBrain F Dec. 9, 2023, 6:17 p.m. OK GNU C++17 (64) TESTS 75 1372 139980800
236607030 EasonLiang F Dec. 10, 2023, 3:32 a.m. OK GNU C++17 (64) TESTS 75 1653 126566400
236594523 anhkha1004 F Dec. 9, 2023, 9:52 p.m. OK GNU C++17 (64) TESTS 75 1778 112230400
236578971 lunchbox F Dec. 9, 2023, 6:56 p.m. OK GNU C++17 (64) TESTS 75 2745 360243200
236573956 Geothermal F Dec. 9, 2023, 6:23 p.m. OK GNU C++17 (64) TESTS 75 3728 257024000
236569314 Geothermal F Dec. 9, 2023, 5:59 p.m. OK GNU C++17 (64) TESTS 75 3775 257024000
236570080 shenzihan F Dec. 9, 2023, 6:01 p.m. OK GNU C++20 (64) TESTS 75 919 470528000
236588315 oToToT F Dec. 9, 2023, 8:30 p.m. OK GNU C++20 (64) TESTS 75 1138 159539200
236595732 aturaling F Dec. 9, 2023, 10:15 p.m. OK GNU C++20 (64) TESTS 75 1263 205824000
236614595 luogu_bot5 F Dec. 10, 2023, 5:42 a.m. OK GNU C++20 (64) TESTS 75 1310 205824000
236599339 Sparkle_Twilight F Dec. 9, 2023, 11:59 p.m. OK GNU C++20 (64) TESTS 75 1325 178278400
236576621 111445 F Dec. 9, 2023, 6:37 p.m. OK GNU C++20 (64) TESTS 75 1325 178278400
236593012 T4M0FEY F Dec. 9, 2023, 9:25 p.m. OK GNU C++20 (64) TESTS 75 1512 95539200
236592950 T4M0FEY F Dec. 9, 2023, 9:24 p.m. OK GNU C++20 (64) TESTS 75 1575 95744000
236569573 thisislike_fan F Dec. 9, 2023, 6 p.m. OK GNU C++20 (64) TESTS 75 1621 144896000
236589752 Siberian F Dec. 9, 2023, 8:50 p.m. OK GNU C++20 (64) TESTS 75 1840 387481600
236611122 sansen F Dec. 10, 2023, 4:49 a.m. OK Rust 2021 TESTS 75 608 160870400
236610032 sansen F Dec. 10, 2023, 4:29 a.m. OK Rust 2021 TESTS 75 654 172544000

remove filters

Back to search problems