Good Bye 2025

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
2178 Good Bye 2025 FINISHED False 10800 9559523 Dec. 27, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1808 ) F Conquer or of Forest PROGRAMMING combinatorics dfs and similar dsu trees

Define the unique ornamental coloring of a rooted tree(^{\text{∗}}) as the following vertex coloring: A vertex (v) is colored white if the number of vertices in the subtree(^{\text{†}}) rooted at (v) is even; Otherwise, (v) is colored black. On his quest to conquer a forest of Christmas trees, Yuuki encountered an ornamentally colored tree (T) with (n) vertices labeled from (1) to (n), rooted at vertex (1). Yuuki considers the tree conquered if and only if at least one of the following conditions holds: There are no white vertices in the tree, or There exists some vertex (v) such that all white vertices lie on the simple path from the root (1) to (v). To conquer the tree, Yuuki can apply the following operation on (T) an arbitrary number of times (possibly zero): First, choose a vertex (w) that is colored white and is not the root of (T). Let (p_w) be the parent of (w). Then, remove the edge connecting (p_w) and (w), and add an edge between any two vertices such that (T) remains a tree. Finally, recolor the vertices of (T) such that it is ornamentally colored. Note that (T) is always rooted at vertex (1). Compute the number of distinct(^{\text{‡}}) conquered trees that Yuuki can construct by applying the above operation an arbitrary number of times on (T). Since the answer may be large, output it modulo (998\,244\,353). Note that Yuuki cannot stop midway through an operation (in particular, he must recolor the tree before checking if it is conquered ). Additionally, Yuuki is allowed to apply the operation even if the tree is already conquered . (^{\text{∗}})A tree is a connected graph without cycles. (^{\text{†}})A subtree of vertex (v) is the subgraph of (v), all its descendants, and all the edges between them. (^{\text{‡}})Two trees are considered distinct if and only if there exists a pair of vertices such that there is an edge

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
355438426 CCCCOrz F Dec. 28, 2025, 4:14 a.m. OK C++17 (GCC 7-32) TESTS 42 140 15257600
355398554 jiangtaizhe001 F Dec. 27, 2025, 5:07 p.m. OK C++17 (GCC 7-32) TESTS 42 187 8089600
355440573 mkx2023275_ F Dec. 28, 2025, 4:51 a.m. OK C++17 (GCC 7-32) TESTS 42 187 11264000
355394725 lastans F Dec. 27, 2025, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 42 187 11571200
355402527 h7373 F Dec. 27, 2025, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 42 234 11264000
355395738 Splashing F Dec. 27, 2025, 4:58 p.m. OK C++17 (GCC 7-32) TESTS 42 234 16179200
355397976 ClarkW F Dec. 27, 2025, 5:05 p.m. OK C++17 (GCC 7-32) TESTS 42 234 28160000
355430685 LISOP9527 F Dec. 28, 2025, 1:31 a.m. OK C++17 (GCC 7-32) TESTS 42 250 15360000
355418024 peteza F Dec. 27, 2025, 8:25 p.m. OK C++17 (GCC 7-32) TESTS 42 250 17612800
355437161 1225Xia F Dec. 28, 2025, 3:50 a.m. OK C++17 (GCC 7-32) TESTS 42 250 23449600
355428952 qsj F Dec. 28, 2025, 12:46 a.m. OK C++20 (GCC 13-64) TESTS 42 140 19353600
355405331 huang123zs F Dec. 27, 2025, 5:27 p.m. OK C++20 (GCC 13-64) TESTS 42 140 24473600
355393264 www_bilibili_com F Dec. 27, 2025, 4:51 p.m. OK C++20 (GCC 13-64) TESTS 42 203 28876800
355406083 MYJBCHX F Dec. 27, 2025, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 42 203 29184000
355431000 gvihvo F Dec. 28, 2025, 1:39 a.m. OK C++20 (GCC 13-64) TESTS 42 203 30003200
355394227 while_ezez F Dec. 27, 2025, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 42 203 32256000
355405104 Richard1211 F Dec. 27, 2025, 5:26 p.m. OK C++20 (GCC 13-64) TESTS 42 203 71372800
355435600 durduryu F Dec. 28, 2025, 3:21 a.m. OK C++20 (GCC 13-64) TESTS 42 218 19558400
355407112 Bonely_Muffin F Dec. 27, 2025, 5:32 p.m. OK C++20 (GCC 13-64) TESTS 42 218 29491200
355446216 fisher199 F Dec. 28, 2025, 6:05 a.m. OK C++20 (GCC 13-64) TESTS 42 218 30720000

remove filters

Back to search problems