注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Summer Intern OA : 一月份拿到的OA
求大米!
分享一道coding:
About Shipping
A shop has $n$ types of items, where the quantity of the $i^{\text{th}}$ item is denoted by quantity[i]. These items are to be shipped in two consignments:
- The first consignment contains items $[1, 2, \dots, j]$
- The second consignment contains the remaining items $[j+1, \dots, n]$
The value of $j$ can be chosen such that $1 \le j < n$ (1-baswing parameters:
- int quantity[n]: the quantities of each item type
Returns:
- long_int: the minimum number of operations required to make the sums equal in an optimal division
|