取数游戏
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.
Description
给出一个数列 a, 甲乙两人每次从数列中拿取一个数,直到取完为止。 甲先手。获得的分数为每人取到所有数字的数字和。
现在藤藤想知道, 如果两人都按照最优策略取, 甲的分数比乙高多少。
Format
Input
输入共 行。
第 行, 一个整数 , 代表数列 的长度。
第 行, 个整数, 代表数列中每个数的值。
Output
输出仅一个整数。 如果两人都按照最优策略取, 甲的分数与乙的分数之差。
Samples
3
1 2 4
3
Limitation
1s, 1024KiB for each test case.
对于 的数据, .
对于 的数据, .
20241031周赛
- Status
- Done
- Rule
- IOI
- Problem
- 6
- Start at
- 2024-10-31 16:45
- End at
- 2024-10-31 18:30
- Duration
- 1.8 hour(s)
- Host
- Partic.
- 16