We will hold Luogu Round 273 on Luogu. This is a Div.1/2 round. English statement will be provided officially. You can click the button to change language.

- Contest URL:
- Div.1: https://www.luogu.com.cn/contest/309087
- Div.2: https://www.luogu.com.cn/contest/309086
- Start Time: 03.01 14:00(UTC+8)
- Duration: 240 minutes
- System: IOI
- Difficulty: CF Div.1/2
- Staffs: VinstaG173, dottle, _istil, OIer1048576, mrsrz, zlxFTH
- Rated range: Div.1 unlimited. Div.2 <=2000 rating on Luogu
- Score distribution: 100-100-100-100
We are looking forward to your participation!
- A tutorial on using Luogu (Please note that
#pragma GCC optimizeis temporarily banned for some reason on Luogu.) - A brief introduction to Chinese NOI








Auto comment: topic has been updated by luogu_official (previous revision, new revision, compare).
Auto comment: topic has been updated by luogu_official (previous revision, new revision, compare).
The editorial for Div.1 C seeems to claim that the problem is reduced to counting vertex colorings of a chordal graph, but I have a case
which I think has a $$$4$$$-cycle and the answer is $$$6570$$$. Am I missing something?
Oh no I think it's right.
But the conditions for achieving this situation are more demanding, I will try to improve the solution.
Oh I know what happened.
There will be only one vertex which represents the character $$$t_{k+1}$$$, where $$$k$$$ denotes $$$\max p_i$$$, it will be connected to all the vertices $$$s_{i+p_i}$$$, where $$$p_i=k$$$. This may make the graph to have $$$4$$$-cycles.
I will try to find out if we can solve this problem.
One possible solution is to set $$$m$$$ to $$$\max p_i$$$, and I think the solution will be all right.
For the original version, maybe it's hard to find out a good solution. It's my fault.
Maybe the problem is simple. If there is some $$$p_{i+k} \gt 0$$$ where $$$p_i=k$$$, then we have $$$t_{k+1}\neq s_1$$$, so the graph is still a chordal graph. Otherwise, we have $$$\forall p_i=k,p_{i+k}=0$$$, that is, we can first count vertex colorings while $$$t_{k+1}\neq s_1$$$, where we can construct a chordal graph. Then as $$$s_{i+k}\neq s_1$$$, so we can set $$$t_{k+1}=s_1$$$, and count the colorings of the rest part, this is a chordal graph as we proved in the editorial.
qpqpqpqpqp