link:array[1..400] of integer;
v:array[1..400] of boolean;
tot, i,j,k,l,n,m:integer;
function find(x:integer):boolean;
var i,j,k:integer;
begin
for i:=1 to n do
if a[x,i] then
if not v[i] then
begin
v[i]:=true;
if (link[i]=0) or (find(i)) then
begin
link[i]:=x;
exit(true);
end;
end;
exit(false);
end;
begin
readln(n,m);
for i:=1 to n do
begin
read(k);
for j:=1 to k do
begin
read(l);
a[i+m,l]:=true;
a[l,i+m]:=true;
end;
end;
n:=n+m;
for i:=1 to n do
begin
fillchar(v,sizeof(v),0);
if find(i) then inc(tot);
end;
writeln(tot div 2);
end.
测试结果1: 通过本测试点|有效耗时156ms
测试结果2: 通过本测试点|有效耗时157ms
测试结果3: 通过本测试点|有效耗时47ms
测试结果4: 通过本测试点|有效耗时46ms
测试结果5: 通过本测试点|有效耗时47ms
测试结果6: 通过本测试点|有效耗时172ms
测试结果7: 通过本测试点|有效耗时172ms
测试结果8: 通过本测试点|有效耗时172ms
测试结果9: 通过本测试点|有效耗时172ms
测试结果10: 测试结果错误.错误结果为:200
正确结果应为:100