记录编号 202762 评测结果 AAAAAAAAAA
题目名称 邮递员 最终得分 100
用户昵称 GravatarVacaTionGOD 是否通过 通过
代码语言 Pascal 运行时间 0.003 s
提交时间 2015-11-01 23:32:47 内存使用 0.33 MiB
显示代码纯文本
//Euler回路
var
  x,y,z,n,i,j,k,ans,m,p:longint;
  a,b:char;
  t:array[0..201,0..201] of longint;
  d:array[0..2000] of longint;
  w:array[0..201] of longint;
procedure Go_Deep(r:longint);
var
  i:longint;
begin
  for i:=1 to n do
   if (t[r,i]<>0) then
    begin
      dec(t[r,i]);
      dec(t[i,r]);
      GO_Deep(i);
    end;
   inc(p);
   d[p]:=r;
end;
begin
assign(input,'carrier.in');
reset(input);
assign(output,'carrier.out');
rewrite(output);
  readln(n,m);
  for i:=1 to n do read(x); // useless
  for i:=1 to m do
   begin
     readln(x,y);
     inc(t[x,y]);
     inc(t[y,x]);
   end;
  writeln(m);
  p:=0;
  Go_Deep(1);
  for i:=p downto 2 do
   write(d[i],' ');
  writeln(d[1]);
close(input);
close(output);
end.