Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
NTUCPC Speed Run! #1
比賽已結束,感謝大家的參與!
題目連結
IOICamp 2025 PreExam 進行中!
IOICamp 官網
、
PreExam 連結
程式解題社網站
程式解題社網站
上線了!
476 . 不要硬幣
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
diobrando97
User's AC Ratio
100.0% (
5/5
)
Submission's AC Ratio
54.5% (
6
/
11
)
Tags
Show solution-related tags
ytp
ytp-junior
ytp-2024
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
5 2
1 2 3 4 5
Sample Output 1
copy
3 2
1 4
Sample Input 2
copy
9 1
4 2 3 3 5 5 5 5 5
Sample Output 2
copy
5 1
2
Sample Input 3
copy
9 3
4 2 3 3 5 15 25 35 45
Sample Output 3
copy
3 2
1 4
Hints
Problem Source
YTP 2024 國中組程式挑戰營 p9
Subtasks
No.
Testdata Range
Constraints
Score
1
0~2
範例測資
0
2
0~27
$n \leq 20$
4
3
0~90
無額外限制
16
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
2000
1048576
65536
1
2
3
1
2000
1048576
65536
1
2
3
2
2000
1048576
65536
1
2
3
3
2000
1048576
65536
2
3
4
2000
1048576
65536
2
3
5
2000
1048576
65536
2
3
6
2000
1048576
65536
2
3
7
2000
1048576
65536
2
3
8
2000
1048576
65536
2
3
9
2000
1048576
65536
2
3
10
2000
1048576
65536
2
3
11
2000
1048576
65536
2
3
12
2000
1048576
65536
2
3
13
2000
1048576
65536
2
3
14
2000
1048576
65536
2
3
15
2000
1048576
65536
2
3
16
2000
1048576
65536
2
3
17
2000
1048576
65536
2
3
18
2000
1048576
65536
2
3
19
2000
1048576
65536
2
3
20
2000
1048576
65536
2
3
21
2000
1048576
65536
2
3
22
2000
1048576
65536
2
3
23
2000
1048576
65536
2
3
24
2000
1048576
65536
2
3
25
2000
1048576
65536
2
3
26
2000
1048576
65536
2
3
27
2000
1048576
65536
2
3
28
2000
1048576
65536
3
29
2000
1048576
65536
3
30
2000
1048576
65536
3
31
2000
1048576
65536
3
32
2000
1048576
65536
3
33
2000
1048576
65536
3
34
2000
1048576
65536
3
35
2000
1048576
65536
3
36
2000
1048576
65536
3
37
2000
1048576
65536
3
38
2000
1048576
65536
3
39
2000
1048576
65536
3
40
2000
1048576
65536
3
41
2000
1048576
65536
3
42
2000
1048576
65536
3
43
2000
1048576
65536
3
44
2000
1048576
65536
3
45
2000
1048576
65536
3
46
2000
1048576
65536
3
47
2000
1048576
65536
3
48
2000
1048576
65536
3
49
2000
1048576
65536
3
50
2000
1048576
65536
3
51
2000
1048576
65536
3
52
2000
1048576
65536
3
53
2000
1048576
65536
3
54
2000
1048576
65536
3
55
2000
1048576
65536
3
56
2000
1048576
65536
3
57
2000
1048576
65536
3
58
2000
1048576
65536
3
59
2000
1048576
65536
3
60
2000
1048576
65536
3
61
2000
1048576
65536
3
62
2000
1048576
65536
3
63
2000
1048576
65536
3
64
2000
1048576
65536
3
65
2000
1048576
65536
3
66
2000
1048576
65536
3
67
2000
1048576
65536
3
68
2000
1048576
65536
3
69
2000
1048576
65536
3
70
2000
1048576
65536
3
71
2000
1048576
65536
3
72
2000
1048576
65536
3
73
2000
1048576
65536
3
74
2000
1048576
65536
3
75
2000
1048576
65536
3
76
2000
1048576
65536
3
77
2000
1048576
65536
3
78
2000
1048576
65536
3
79
2000
1048576
65536
3
80
2000
1048576
65536
3
81
2000
1048576
65536
3
82
2000
1048576
65536
3
83
2000
1048576
65536
3
84
2000
1048576
65536
3
85
2000
1048576
65536
3
86
2000
1048576
65536
3
87
2000
1048576
65536
3
88
2000
1048576
65536
3
89
2000
1048576
65536
3
90
2000
1048576
65536
3
Submit
Back to Top