Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
NTUCPC Speed Run! #1
比賽已結束,感謝大家的參與!
題目連結
IOICamp 2025 PreExam 進行中!
IOICamp 官網
、
PreExam 連結
程式解題社網站
程式解題社網站
上線了!
453 . 拍照
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
餘切
$\huge\text{owoovo is 8}$
User's AC Ratio
100.0% (
22/22
)
Submission's AC Ratio
41.5% (
80
/
193
)
Tags
Show solution-related tags
ytp
ytp-senior
ytp-2024
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
10 4
3 1
5 2
6 4
7 5
9 7
10 10
11 11
12 15
14 18
15 19
Sample Output 1
copy
22
Hints
Problem Source
YTP 2024 高中組程式挑戰營 p12
Subtasks
No.
Testdata Range
Constraints
Score
1
0
範例測資
0
2
0~31
$N \leq 500$
4
3
0~96
無額外限制
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
2
3
2
2000
1048576
65536
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
2
3
29
2000
1048576
65536
2
3
30
2000
1048576
65536
2
3
31
2000
1048576
65536
2
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
91
2000
1048576
65536
3
92
2000
1048576
65536
3
93
2000
1048576
65536
3
94
2000
1048576
65536
3
95
2000
1048576
65536
3
96
2000
1048576
65536
3
Submit
Back to Top