#P3679. [CERC2016] 二分毯 Bipartite Blanket
[CERC2016] 二分毯 Bipartite Blanket
Description
In a bipartite graph, all vertices are split into two disjoint sets and , and every edge connects some vertex in to some vertex in . A matching is a set of edges such that no two edges share an endpoint. We say a matching covers a vertex set if and only if every vertex in is an endpoint of at least one edge in .
Given a bipartite graph where each vertex has a positive integer weight, define the weight of a vertex set as the sum of the weights of its vertices.
Given a parameter , count how many vertex sets satisfy that the weight of is at least , and is covered by at least one matching .
Input Format
The first line contains two positive integers , denoting the number of vertices in set and set , respectively.
The next lines each contain binary characters '0' or '1'. In the -th row and the -th column, a indicates there is an edge between and .
The next line contains positive integers , denoting the weight of each vertex in .
The next line contains positive integers , denoting the weight of each vertex in .
The last line contains a positive integer , representing the parameter .
Output Format
Output a single integer on one line, the number of vertex sets that satisfy the condition.
3 3
010
111
010
1 2 3
8 5 13
21
3
3 2
01
11
10
1 2 3
4 5
8
13
Hint
, , .
Translated by ChatGPT 5
京公网安备 11011102002149号