Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2022 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2023 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2239 . 地洞遊戲
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
$\mathbb{W}\mathcal{aimai}\sim$
User's AC Ratio
66.7% (
16/24
)
Submission's AC Ratio
20.6% (
26
/
126
)
Tags
Show solution-related tags
pre-nhspc-2021
全國模擬賽
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
5 3
2 2 3
0
2 4 5
0
0
-1 1 -1 1 3
Sample Output 1
copy
Yes
2 5 4
Sample Input 2
copy
8 5
3 2 3 4
3 5 7 8
0
0
1 6
0
0
0
-1 -1 1 1 -1 1 2 1
Sample Output 2
copy
Yes
6 7 8 3 4
Sample Input 3
copy
5 2
2 2 4
1 3
0
1 5
0
-1 -1 2 -1 5
Sample Output 3
copy
No
Hints
Problem Source
110 學年度全國資訊學科能力競賽模擬賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~2
範例測資
0
2
0~27
$K \leq 16$
18
3
28~42
對於每個滿足 $t_i > 0$ 的 $i$,$i$ 會出現在 $a_1 \sim a_N$ 中最多 $t_i-1$ 次
23
4
0~64
無額外限制
59
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
2000
524288
65536
1
2
4
1
2000
524288
65536
1
2
4
2
2000
524288
65536
1
2
4
3
2000
524288
65536
2
4
4
2000
524288
65536
2
4
5
2000
524288
65536
2
4
6
2000
524288
65536
2
4
7
2000
524288
65536
2
4
8
2000
524288
65536
2
4
9
2000
524288
65536
2
4
10
2000
524288
65536
2
4
11
2000
524288
65536
2
4
12
2000
524288
65536
2
4
13
2000
524288
65536
2
4
14
2000
524288
65536
2
4
15
2000
524288
65536
2
4
16
2000
524288
65536
2
4
17
2000
524288
65536
2
4
18
2000
524288
65536
2
4
19
2000
524288
65536
2
4
20
2000
524288
65536
2
4
21
2000
524288
65536
2
4
22
2000
524288
65536
2
4
23
2000
524288
65536
2
4
24
2000
524288
65536
2
4
25
2000
524288
65536
2
4
26
2000
524288
65536
2
4
27
2000
524288
65536
2
4
28
2000
524288
65536
3
4
29
2000
524288
65536
3
4
30
2000
524288
65536
3
4
31
2000
524288
65536
3
4
32
2000
524288
65536
3
4
33
2000
524288
65536
3
4
34
2000
524288
65536
3
4
35
2000
524288
65536
3
4
36
2000
524288
65536
3
4
37
2000
524288
65536
3
4
38
2000
524288
65536
3
4
39
2000
524288
65536
3
4
40
2000
524288
65536
3
4
41
2000
524288
65536
3
4
42
2000
524288
65536
3
4
43
2000
524288
65536
4
44
2000
524288
65536
4
45
2000
524288
65536
4
46
2000
524288
65536
4
47
2000
524288
65536
4
48
2000
524288
65536
4
49
2000
524288
65536
4
50
2000
524288
65536
4
51
2000
524288
65536
4
52
2000
524288
65536
4
53
2000
524288
65536
4
54
2000
524288
65536
4
55
2000
524288
65536
4
56
2000
524288
65536
4
57
2000
524288
65536
4
58
2000
524288
65536
4
59
2000
524288
65536
4
60
2000
524288
65536
4
61
2000
524288
65536
4
62
2000
524288
65536
4
63
2000
524288
65536
4
64
2000
524288
65536
4
Submit
Back to Top