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

建议使用的浏览器:

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

6445:Search for Answer

题目描述
Given a tournament, you need to determine the direction of the remaining sides to maximize the answer. The answer is calculated in the following way. The vertices are labeled from $0$ to $n-1$, and the matrix $s$ is used to represent the edges.
输入解释
The first line of input is a single line of integer $T (2 \le T \le 10)$, the number of test cases. In each test case, there are $1$ integers $n(5 \le n \le 200)$, denoting the number of vertices. Then in the following $n$ lines, the $i$-th line has a string of length $n$. If $s[i][j]=1$, there is an edge from $i$ to $j$. If $s[i][j]=2$ means you need to determine the direction for that edge. The input is guaranteed to be legal, and the number of $(i, j) (i < j)$ satisfying $s[i][j]=s[j][i]=2$ is less than $200$. The data is randomly generated.
输出解释
For each set of test samples, output one line to represent the maximized answer.
输入样例
2
5
02112
20221
02001
02102
20020
5
01112
00022
01012
02002
22220
输出样例
40
24
提示
One solution to the first case is:
00110
10001
01001
01100
10010
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6445

最后修改于 2020-10-25T23:31:00+00:00 由爬虫自动更新

共提交 0

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