#G. 负载平衡问题

    Type: RemoteJudge 1000ms 125MiB

负载平衡问题

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.

题目描述

GG 公司有 nn 个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等。如何用最少搬运量可以使 nn 个仓库的库存数量相同。搬运货物时,只能在相邻的仓库之间搬运。

输入格式

第一行一个正整数 nn,表示有 nn 个仓库。

第二行 nn 个正整数,表示 nn 个仓库的库存量。

输出格式

输出最少搬运量。

5
17 9 14 16 4
11

提示

1n1001 \leq n \leq 100

ch24 - 网络流

Not Claimed
Status
Done
Problem
8
Open Since
2024-1-31 12:00
Deadline
2024-3-3 23:59
Extension
2400 hour(s)