TopCoder

拉菲好可愛 >////<
迷子でもいい、迷子でも進め!

User's AC Ratio

87.5% (7/8)

Submission's AC Ratio

26.7% (12/45)

Tags

Description

Input Format

Output Format

Sample Input 1

5 8
1 3
1 2
4 0 1 2 3
1 2
3 0 1 4
toggle 4
mex-add
mex-add
toggle 4
toggle 2
mex-add
toggle 3
mex-add

Sample Output 1

20
20
22
34
36
40
37
46

Sample Input 2

3 8
2 0 2
1 2
0
toggle 0
toggle 1
toggle 0
toggle 2
toggle 0
toggle 1
toggle 0
toggle 2

Sample Output 2

5
2
2
4
4
7
7
5

Sample Input 3

4 10
4 0 1 2 3
4 0 1 2 3
4 0 1 2 3
4 0 1 2 3
toggle 2
mex-add
toggle 1
mex-add
toggle 0
toggle 3
mex-add
toggle 2
mex-add
mex-add

Sample Output 3

8
8
12
24
24
12
12
4
12
24

Hints

Problem Source

YTP 2024 國中組初賽 p7

Subtasks

No. Testdata Range Constraints Score
1 0~2 範例測資 0
2 3~12 $op_j = \texttt{toggle}$ 3
3 13~19 $k_i = n$ 6
4 0~25 無額外限制 11

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 262144 65536 1 4
1 1000 262144 65536 1 4
2 1000 262144 65536 1 4
3 1000 262144 65536 2 4
4 1000 262144 65536 2 4
5 1000 262144 65536 2 4
6 1000 262144 65536 2 4
7 1000 262144 65536 2 4
8 1000 262144 65536 2 4
9 1000 262144 65536 2 4
10 1000 262144 65536 2 4
11 1000 262144 65536 2 4
12 1000 262144 65536 2 4
13 1000 262144 65536 3 4
14 1000 262144 65536 3 4
15 1000 262144 65536 3 4
16 1000 262144 65536 3 4
17 1000 262144 65536 3 4
18 1000 262144 65536 3 4
19 1000 262144 65536 3 4
20 1000 262144 65536 4
21 1000 262144 65536 4
22 1000 262144 65536 4
23 1000 262144 65536 4
24 1000 262144 65536 4
25 1000 262144 65536 4