记录编号 |
22226 |
评测结果 |
AAAAAAAAAA |
题目名称 |
邮递员 |
最终得分 |
100 |
用户昵称 |
Des. |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.004 s |
提交时间 |
2010-11-17 20:46:07 |
内存使用 |
0.32 MiB |
显示代码纯文本
program carrier;
var l:array[1..20000]of longint;
a:array[1..200,1..200]of integer;
t,k,m,n,i1,i2,i,j:longint;
procedure sou(i,j:longint);
var t,k:longint;
begin
{if j=m+1 then
begin
writeln(m);
for t:=1 to m+1 do
write(l[t],' ');
close(output);
halt;
end;}
for t:=1 to n do
begin
if a[i,t]>=1 then
begin
inc(i2);
dec(a[i,t]);
dec(a[t,i]);
sou(t,i2);
end;
end;
inc(i1);
l[i1]:=i;
end;
begin
assign(input,'carrier.in');
reset(input);
assign(output,'carrier.out');
rewrite(output);
readln(n,m);
for t:=1 to n do
readln;
for t:=1 to m do
begin
readln(i,j);
inc(a[i,j]);
inc(a[j,i]);
end;
i1:=0;
i2:=0;
sou(1,1);
writeln(m);
for t:=m+1 downto 1 do
write(l[t],' ');
close(output);
end.