ac1089.pas
来自「同济大学 Online在线题库 AC源代码合集 程序设计竞赛必看资料」· PAS 代码 · 共 42 行
PAS
42 行
program tju1089;
const
max=100;
var
adj:array[1..max,1..max]of boolean;
my:array[1..max]of byte;
vy:array[1..max]of boolean;
n,m,i,j,count:byte;
function aug(x:byte):boolean;
var
i:byte;
begin
for i:=1 to m do
if adj[x,i] and not vy[i] then begin
vy[i]:=true;
if (my[i]=0) or aug(my[i]) then begin
my[i]:=x;aug:=true;exit;
end;
end;
aug:=false;
end;
begin
repeat
fillchar(adj,sizeof(adj),0);
read(n,m);
repeat
read(i,j);
if i=0 then break;
adj[i,j]:=true;
until false;
fillchar(my,sizeof(my),0);
count:=0;
for i:=1 to n do begin
fillchar(vy,sizeof(vy),0);
if aug(i) then inc(count);
end;
if count>n-2 then writeln('FreeDian') else writeln(n-1-count,'000000000');
until seekeof;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?