#P16784. [蓝桥杯 2026 国 A] 圆形灯环

    ID: 19125 远端评测题 5000ms 512MiB 尝试: 1 已通过: 1 显示难度提高 上传者: 标签>动态规划 DP提交答案群论容斥原理2026蓝桥杯国赛

[蓝桥杯 2026 国 A] 圆形灯环

Problem Description

Xiao Lan bought a smart circular light ring. The ring consists of 20262026 LED beads connected end to end, arranged in clockwise order.

Each bead can be independently set to one of 2626 different brightness levels, labeled from 00 to 2525.

To prevent damage caused by unstable current, the overall brightness configuration of the ring must be in a stable state. A “stable” configuration must satisfy both of the following conditions:

  1. In the clockwise direction, for any 33 consecutive beads, the sum of their brightness levels must not be equal to 2626.
  2. In the clockwise direction, the total number of occurrences of the adjacent pair with brightness levels 22 then 66 (that is, the previous bead is level 22 and the next bead is level 66) across the entire ring must be even.

In addition, due to the closed nature of the ring, the last bead and the first bead are also adjacent (for example, if the tail is level 22 and the head is level 66, it is counted in the number of occurrences of the above pair as usual).

Also, since the ring can rotate freely, any configurations that can coincide with each other by a clockwise rotation (i.e., a cyclic shift) are considered essentially the same solution.

Now, help Xiao Lan compute how many essentially different stable brightness configurations there are. Since the final number may be very large, output it modulo 998244353998244353.

Output Format

This is an output-only fill-in-the-blank problem. You only need to compute the result and submit it. The answer is an integer. When submitting, you only need to write a program that outputs this integer. Any extra content will result in no score.



Hint

Translated by ChatGPT 5