#P3973. [TJOI2015] 线性代数
[TJOI2015] 线性代数
Description
To improve her IQ, ZJY starts to study linear algebra.
Her friend Boluo gives her the following problem: Given an matrix and a matrix . Find a 0-1 matrix such that is maximized, where is the transpose of , and output .
Input Format
The first line contains an integer .
The next lines give matrix : in the -th line, the -th number is .
The next line contains integers, representing matrix .
Every number in matrices and is a non-negative integer not exceeding .
Output Format
Output a single integer, the maximum value of .
3
1 2 1
3 1 0
1 2 3
2 3 7
2
Hint
- For of the testdata, .
- For of the testdata, .
- There are also two extra unscored hack testdata in subtask 2, with the same ranges as above.
Translated by ChatGPT 5
京公网安备 11011102002149号