土拨鼠分足球
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.
Background
一言
我今天的苦,何尝不是你来日的难。
Description
土拨鼠 杯杯 想给位阿根廷球迷们分,他总共购买了 堆个数不相同 。
为了防止阿根廷球迷们不再支持梅西,土拨鼠 杯杯 想要把这堆分成同样多的。
土拨鼠 杯杯 每次只能把一堆中的一些移动到相邻的一堆中,他一次可以拿多个或一个。
而且为了不耽误看球赛,他想移动尽可能少的次数。请你告诉 杯杯 最少需要移动几次。
Format
Input
一个整数,表示的堆数。
个整数,表示各堆的个数。保证堆的个数总和为的倍数。
Output
最少的移动次数。
Samples
5
6 1 3 2 3
3
第一次移动:1 --3个--> 2
第二次移动:3 --1个--> 4
第三次移动:2 --1个--> 3
Limitation
非常“简单”
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 17
- Start at
- 2025-1-24 17:00
- End at
- 1970-1-1 8:00
- Duration
- -482697 hour(s)
- Host
- Partic.
- 1