Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2022 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2238 . 排隊
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
$\mathbb{W}\mathcal{aimai}\sim$
User's AC Ratio
91.3% (
21/23
)
Submission's AC Ratio
40.3% (
27
/
67
)
Tags
Show solution-related tags
pre-nhspc-2021
全國模擬賽
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
5 4
1 2 3 3 4
2 1
1 1
2 3
1 3
Sample Output 1
copy
3
11
Sample Input 2
copy
8 7
2 1 1 4 7 3 5 4
2 2
1 8
1 9
2 1
1 7
2 2
1 6
Sample Output 2
copy
15
9
14
22
Hints
Problem Source
110 學年度全國資訊學科能力競賽模擬賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資
0
2
0~10
$N,Q \le 5000, A_i \le 5000$;當 $t_j=2$,$k_j\le 5$
8
3
0~1, 11~22
$A_i \le 10$
21
4
23~31
$A_i\le A_{i+1}$
23
5
0~64
無額外限制
48
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1000
524288
65536
1
2
3
5
1
1000
524288
65536
1
2
3
5
2
1000
524288
65536
2
5
3
1000
524288
65536
2
5
4
1000
524288
65536
2
5
5
1000
524288
65536
2
5
6
1000
524288
65536
2
5
7
1000
524288
65536
2
5
8
1000
524288
65536
2
5
9
1000
524288
65536
2
5
10
1000
524288
65536
2
5
11
1000
524288
65536
3
5
12
1000
524288
65536
3
5
13
1000
524288
65536
3
5
14
1000
524288
65536
3
5
15
1000
524288
65536
3
5
16
1000
524288
65536
3
5
17
1000
524288
65536
3
5
18
1000
524288
65536
3
5
19
1000
524288
65536
3
5
20
1000
524288
65536
3
5
21
1000
524288
65536
3
5
22
1000
524288
65536
3
5
23
1000
524288
65536
4
5
24
1000
524288
65536
4
5
25
1000
524288
65536
4
5
26
1000
524288
65536
4
5
27
1000
524288
65536
4
5
28
1000
524288
65536
4
5
29
1000
524288
65536
4
5
30
1000
524288
65536
4
5
31
1000
524288
65536
4
5
32
1000
524288
65536
5
33
1000
524288
65536
5
34
1000
524288
65536
5
35
1000
524288
65536
5
36
1000
524288
65536
5
37
1000
524288
65536
5
38
1000
524288
65536
5
39
1000
524288
65536
5
40
1000
524288
65536
5
41
1000
524288
65536
5
42
1000
524288
65536
5
43
1000
524288
65536
5
44
1000
524288
65536
5
45
1000
524288
65536
5
46
1000
524288
65536
5
47
1000
524288
65536
5
48
1000
524288
65536
5
49
1000
524288
65536
5
50
1000
524288
65536
5
51
1000
524288
65536
5
52
1000
524288
65536
5
53
1000
524288
65536
5
54
1000
524288
65536
5
55
1000
524288
65536
5
56
1000
524288
65536
5
57
1000
524288
65536
5
58
1000
524288
65536
5
59
1000
524288
65536
5
60
1000
524288
65536
5
61
1000
524288
65536
5
62
1000
524288
65536
5
63
1000
524288
65536
5
64
1000
524288
65536
5
Submit
Back to Top