新たな橋 (New Bridge)
Unrated
日本語
Language
Contribute a translation- Time limit
- 2000 ms
- Memory limit
- 1024 MB
- Submissions
- 0
- Correct
- 0
- Solved by
- 0
- AC rate
- —
Statement
Examples
Sample input 1
4 5 2 1 3 2 1 4 4 2 3 1 2 4 5 3 4 3 1 3
Sample output 1
7 3
Sample input 2
5 4 5 1 2 3 2 3 1 3 4 4 4 5 2 1 2 3 4 5
Sample output 2
12 8 7 10 13
Sample input 3
10 20 1 1 2 808642746 1 3 990324141 1 4 69919024 1 5 794837863 3 6 84751636 1 7 491226767 3 8 314795065 1 9 347506932 1 10 709806198 2 3 103026123 9 10 270175384 4 8 133038160 4 10 592110162 2 10 708615085 6 10 262209760 5 10 75049025 7 9 367273075 6 9 264231132 3 10 909786421 2 7 135810916 10
Sample output 3
43
Notes
JOI 2025/2026 セミファイナル 問題5 · JCIOI · CC BY-SA 4.0
Tags
No tags yet