1388. 3n 块披萨bahttps://leetcode.cn/problems/pizza-with-3n-slices/
| 2023-8-18
0  |  阅读时长 0 分钟
Date
Aug 18, 2023
need_review
need_review
type
undo
undo
难度
困难
给你一个披萨,它由 3n 块不同大小的部分组成,现在你和你的朋友们需要按照如下规则来分披萨:
  • 你挑选 任意 一块披萨。
  • Alice 将会挑选你所选择的披萨逆时针方向的下一块披萨。
  • Bob 将会挑选你所选择的披萨顺时针方向的下一块披萨。
  • 重复上述过程直到没有披萨剩下。
每一块披萨的大小按顺时针方向由循环数组 slices 表示。
请你返回你可以获得的披萨大小总和的最大值。
示例 1:
notion image
示例 2:
notion image
提示:
  • 1 <= slices.length <= 500
  • slices.length % 3 == 0
  • 1 <= slices[i] <= 1000

解法1
  • Giscus
目录