34 条题解
-
0艾弗森 LV 8 @ 2009-11-13 17:00:37
..悲剧。。
m,n全部打成n导致第一个通过被tangqihy抢走。。
我是谁?见沙发I.I
-
02009-11-13 17:00:33@
楼下的好可爱~~~
杯具了~ -
02009-11-13 16:58:29@
...!!!! 通过率怎高吧!!!!
-
02009-11-13 16:57:45@
type ave=array[0..50]of longint;
var g,a,b:array[0..302]of longint;
used:array[0..203]of boolean;
c,d:ave;
m,leng1,leng2,n,i,j,bb,k,ans:longint;
v:array[0..203,0..203]of boolean;
function max(x,y:longint):longint;
begin
if x>y then max:=x else max:=y;
end;
procedure zhuanhuan(v:longint; var leng:longint; var r:ave);
begin
leng:=0;
fillchar(r,sizeof(r),0);
if v=0 then
begin
leng:=1;
exit;
end;
while v0 do
begin
inc(leng);
r[leng]:=v mod 2;
v:=v div 2;
end;
end;
function pipei(h:longint):boolean;
var i:longint;
begin
for i:=1 to m do
begin
if (v[h,i])and(g[i]=0) then
begin
g[i]:=h;
pipei:=true;
exit;
end;
if (v[h,i])and(g[i]0)and(not(used[g[i]])) then
begin
used[g[i]]:=true;
if pipei(g[i]) then
begin
g[i]:=h;
pipei:=true;
exit;
end;
end;
end;
pipei:=false;
end;begin
readln(n,m);
for i:=1 to n do read(a[i]);
for i:=1 to m do read(b[i]);
fillchar(v,sizeof(v),false);
for i:=1 to n do
for j:=1 to m do
begin
leng1:=0;
zhuanhuan(a[i],leng1,c);
leng2:=0;
zhuanhuan(b[j],leng2,d);
bb:=1;
for k:=1 to max(leng1,leng2) do if c[k]=d[k] then bb:=0;
if bb=1 then v:=true else v:=false;
end;
ans:=0;
for i:=1 to n do
begin
fillchar(used,sizeof(used),0);
if pipei(i) then inc(ans);
end;
if ans0 then writeln(ans)
else writeln('I want nobody nobody but you');
end.两星半纪念!
-
02009-11-13 16:55:24@
var
a,b:array[1..200] of longint;
map:array[1..400,1..400] of boolean;
match:array[1..400] of longint;
use:array[1..400] of boolean;
i,j,n,m,ans:longint;function find(x:longint):boolean;
var
p:longint;
begin
for p:=1 to n+m do
if (map[x,p])and(not use[p]) then
begin
use[p]:=true;
if (match[p]=0)or(find(match[p])) then
begin
match[x]:=p;
exit(true);
end;
end;
exit(false);
end;begin
readln(n,m);
for i:=1 to n do
read(a[i]);
for j:=1 to m do
read(b[j]);
fillchar(map,sizeof(map),false);
for i:=1 to n do
for j:=1 to m do
if (a[i] xor b[j]+1)and(-(a[i] xor b[j]+1))=a[i] xor b[j]+1 then
begin
map:=true;
map[j+n,i]:=true;
end;
for i:=1 to n do
begin
fillchar(use,sizeof(use),false);
if find(i) then ans:=ans+1;
end;
writeln(ans);
end. -
02009-11-13 16:55:08@
难得的进前十啊...
-
02009-11-13 16:55:06@
其实……
8遍贪心=秒杀
不太好意思了…… -
02009-11-13 16:54:15@
位运算+二分图 0ms!!!
-
02009-11-13 16:47:57@
.裸的最大流
-
02009-11-13 16:21:25@
......
-
02009-11-11 23:01:43@
.....都好快...二分匹配..
-
02009-11-11 22:25:25@
ms网络流的最大流……
-
02009-11-07 01:52:46@
板凳……
初音比赛第二题……
听说题目背景很雷人…… -
02009-11-07 01:16:55@
沙发。哈哈。