TopCoder

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

User's AC Ratio

80.0% (4/5)

Submission's AC Ratio

50.0% (7/14)

Tags

Description

Input Format

Output Format

Sample Input 1

10 6
2 10
1 3
1 8
2 10
1 3
2 10

Sample Output 1

55
3
13

Sample Input 2

15 8
2 15
1 1
2 15
1 1
1 5
2 15
1 6
2 15

Sample Output 2

610
0
165
0

Sample Input 3

10 10
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10

Sample Output 3

1
1
2
3
5
8
13
21
34
55

Sample Input 4

20 20
2 5
2 18
2 12
2 2
2 7
1 11
1 11
1 2
2 9
1 2
1 6
1 6
1 9
1 9
2 12
2 9
1 7
1 4
1 10
2 18

Sample Output 4

5
2584
144
1
13
13
144
34
42

Hints

Problem Source

YTP 2024 國中組程式挑戰營 p12

Subtasks

No. Testdata Range Constraints Score
1 0~3 範例測資 0
2 0~11 $N, Q \leq 5000$ 3
3 12~14 只有第⼆種詢問,樓梯不會壞掉 8
4 12~17 同⼀時間⾄多只有⼗階是壞掉的還沒修好 7
5 0~24 無額外限制 7

Testdata and Limits

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