cswork / OA打开练习工作台

AgodaOA #3

Two-Core Process Assignment

估计中等评测数据准备中,可先阅读题面

考点(AI 标注)树形博弈

You are given an array time of process durations. Same dual-core / latch-toggle rules as problem 1: the latch holder decides whether each next process goes to themselves (latch flips) or to the other core (latch stays). Each core plays optimally to maximize its own total time. Return [S1, S2], the totals assigned to core 1 and core 2.

Example 1

Input:

time = [10, 21, 10, 21, 10]

Output:

[41, 31]

Explanation: Optimal alternating assignment under the latch game yields S1 = 41 and S2 = 31.