题目链接:Rake It In
Description
The designers have come up with a new simple game called “Rake It In”. Two players, Alice and Bob, initially select an integer k and initialize a score indicator. An
board is created with 16 values placed on the board. Starting with player Alice, each player in a round selects a region of the board, adding the sum of values in the region to the score indicator, and then rotating these four values degrees counterclockwise. After
rounds in total, each player has made decision in k times. The ultimate goal of Alice is to maximize the final score. However for Bob, his goal is to minimize the final score. In order to test how good this game is, you are hired to write a program which can play the game. Specifically, given the starting configuration, they would like a program to determine the final score when both players are entirely rational.
Input
The input contains several test cases and the first line provides an integer
which is the number of test cases. Each case contains five lines. The first line provides the integer
. Each of the following four lines contains four integers indicating the values on the board initially. All values are integers between to .
Output
For each case, output an integer in a line which is the predicted final score.
Sample Input
1 | 4 |
Sample Output
1 | 20 |
Solution
题意
有一块
题解
DFS 贪心
比较好的解法是对抗搜索 与
题解给出是上分支定界和启发式搜索。
但是用贪心 + 爆搜竟然过了。
关于对抗搜索和
Code
DFS + 贪心
1 |
|
对抗搜索 +
1 |
|
v1.5.2