当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2291:Five in a Row, Again

题目描述
Each member of WHU ACM Team developed his/her own Five in a row AI application. They are planning to hold an AI competition on the online arena they just developed.
Each AI competitor has to compete with every other participator once. The winner of each game is awarded with credits while the loser gets nothing. No one gets credits in a tied game.

Every competitor has an experience point, which is crucial to the game. In each game, the competitor with higher experience point wins, except for tied games, in which two competitors have the same experience point.

Those AIs are so clever that they will learn from every game. That is to say, no matter win or lose, AIs' experience point may increase after each game.

Alex, the team leader, has the privilege to arrange the game order. He wants to maximum his credit. Please help him solve the problem.
输入解释
The input consists of several test cases. The first line of the input consists of an integer T, indicating the number of test cases.
Each test case starts with a line consist of an integer N, indicating the number of competitors. Each of the following N lines consists of N integers Eij, indicating the experience point the i-th competitor will increase after the game with the j-th competitor. Then, each of the following N lines consists of N integers Wij, indicating the credit the i-th competitor will gain if wins the game with the j-th competitor.

The last line of each test case consists of N integers Si, indicating the initial experience point of each competitor.

By the way, Alex is the first player.
Technical Specification

1. 1 ≤ T ≤ 11
2. 1 ≤ N ≤ 13
3. 0 ≤ Wij ≤ 10
4. 0 ≤ Eij, Si ≤ 1000
输出解释
For each test case, output a single line consists of the maximum credit Alex may get.
输入样例
2
2
0 1
1 0
0 1
1 0
1 1
3
0 5 2
0 0 0
0 0 0
0 10 1
1 0 1
1 0 0
1 10 5
输出样例
0
1
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2291

最后修改于 2020-10-25T22:52:14+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/1000MS(Java/Others) 32768/32768K(Java/Others)