加加加加到厌倦
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
给两个长度为 的数组 和 ,你可以执行以下操作,任意选定 ,将该区间内的 全部加 ,问最少经过多少次操作能将 数组变成 数组,如果无法实现则输出 。
Input
第一行输入 。
第二行输入个数,表示数组 。
第三行输入个数,表示数组 。
Output
输出最小操作数。
Samples
5
5 2 7 2 3
6 4 8 9 10
8
6
1 1 4 5 1 4
1 2 6 2 8 2
-1
Limitation
Time Limit: 1 second
Memory Limit: 256MiB
SDNU_ACM_ICPC_2025新生月赛
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 13
- Start at
- 2025-11-16 12:00
- End at
- 2025-11-16 17:00
- Duration
- 5 hour(s)
- Host
- Partic.
- 38