CF1038C Gambling
题目描述
### 题目大意:
两个人$A,B$玩游戏,每个人有1个长度为$n$的序列,每次一个人可以从序列中拿一个数并加入自己的分数,或者把对手序列中没选的数中去掉一个,这两个人都足够聪明,求$A$分数与$B$分数的差
输入格式
第一行一个整数$n$
第二行$n$个整数,表示A的序列
第三行$n$个整数,表示B的序列
第一行一个整数$n$
第二行$n$个整数,表示A的序列
第三行$n$个整数,表示B的序列
输出格式
一个整数,表示$A$分数与$B$分数的差
```
### 题目大意:
两个人$A,B$玩游戏,每个人有1个长度为$n$的序列,每次一个人可以从序列中拿一个数并加入自己的分数,或者把对手序列中没选的数中去掉一个,这两个人都足够聪明,求$A$分数与$B$分数的差
一个整数,表示$A$分数与$B$分数的差
```
说明/提示
In the first example, the game could have gone as follows:
- A removes $ 5 $ from B's list.
- B removes $ 4 $ from A's list.
- A takes his $ 1 $ .
- B takes his $ 1 $ .
Hence, A's score is $ 1 $ , B's score is $ 1 $ and difference is $ 0 $ .
There is also another optimal way of playing:
- A removes $ 5 $ from B's list.
- B removes $ 4 $ from A's list.
- A removes $ 1 $ from B's list.
- B removes $ 1 $ from A's list.
The difference in the scores is still $ 0 $ .
In the second example, irrespective of the moves the players make, they will end up with the same number of numbers added to their score, so the difference will be $ 0 $ .