Codeforces Round 1010 (Div. 1, Unrated)

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
2081 Codeforces Round 1010 (Div. 1, Unrated) FINISHED False 10800 34356323 March 15, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 80 ) E Quantifier PROGRAMMING combinatorics dp implementation

Given a rooted tree with (n+1) nodes labeled from (0) to (n), where the root is node (0), and its only child is node (1) . There are (m) distinct chips labeled from (1) to (m), each colored either black or white. Initially, they are arranged on edge ((0,1)) from top to bottom in ascending order of labels. You can perform the following operations any number of times (possibly zero) in any order: Select two edges ((u,v)) and ((v,w)) such that (u) is the parent of (v) and (v) is the parent of (w), where edge ((u,v)) contains at least one chip. Move the bottommost chip on edge ((u,v)) to the topmost place on edge ((v,w)), i. e., above all existing chips on ((v,w)). Select two edges ((u,v)) and ((v,w)) such that (u) is the parent of (v) and (v) is the parent of (w), where edge ((v,w)) contains at least one chip. Move the topmost chip on edge ((v,w)) to the bottommost place on edge ((u,v)), i. e., below all existing chips on ((u,v)). Select two adjacent chips of the same color on the same edge, and swap their positions. Each chip (i) has a movement range, defined as all edges on the simple path from the root to node (d_i). During operations, you must ensure that no chip is moved to an edge outside its movement range. Finally, you must move all chips back to edge ((0,1)). It can be found that the order of the chips may change. Compute the number of possible permutations of chips for the final arrangement on the edge ((0,1)) modulo (998\,244\,353). A permutation of chips is defined as a sequence of length (m) consisting of the labels of the chips from top to bottom. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 5000)). The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ($$$1 \le n, m \le 5000$

Tutorials

Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
310770842 StarSilk E March 15, 2025, 5:08 p.m. OK C++20 (GCC 13-64) TESTS 32 1249 702976000
310801311 Sparkle_Twilight E March 15, 2025, 9:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 32 1186 702976000
310783858 jatking E March 15, 2025, 6:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 32 1218 702976000

remove filters

Back to search problems