Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
NTUCPC Speed Run! #1
比賽已結束,感謝大家的參與!
題目連結
IOICamp 2025 PreExam 進行中!
IOICamp 官網
、
PreExam 連結
程式解題社網站
程式解題社網站
上線了!
292 . 費馬最後定理
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
主唱太拼命了
User's AC Ratio
75.0% (
3/4
)
Submission's AC Ratio
17.6% (
6
/
34
)
Tags
Show solution-related tags
ytp
ytp-senior
ytp-2023
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
3 3
000
000
000
111
111
111
100
000
000
3
1 1 2
1 1 2
Sample Output 1
copy
011
111
111
Sample Input 2
copy
3 2
10
00
01
01
10
00
3
604078599 524693017 85841332
671146413 219874579 658380675
Sample Output 2
copy
10
00
Hints
Problem Source
YTP 2023 高中組程式挑戰營 p9
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資
0
2
2~6
$N, Q \leq 3000$
1
3
0~11
$N, Q \leq 3 \times 10^ 5$
2
4
0~16
$Q \leq 3 \times 10^ 6$
4
5
0~21
無額外限制
13
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
5000
524288
65536
1
3
4
5
1
5000
524288
65536
1
3
4
5
2
5000
524288
65536
2
3
4
5
3
5000
524288
65536
2
3
4
5
4
5000
524288
65536
2
3
4
5
5
5000
524288
65536
2
3
4
5
6
5000
524288
65536
2
3
4
5
7
5000
524288
65536
3
4
5
8
5000
524288
65536
3
4
5
9
5000
524288
65536
3
4
5
10
5000
524288
65536
3
4
5
11
5000
524288
65536
3
4
5
12
5000
524288
65536
4
5
13
5000
524288
65536
4
5
14
5000
524288
65536
4
5
15
5000
524288
65536
4
5
16
5000
524288
65536
4
5
17
5000
524288
65536
5
18
5000
524288
65536
5
19
5000
524288
65536
5
20
5000
524288
65536
5
21
5000
524288
65536
5
Submit
Back to Top