记录编号 266122 评测结果 AAAAAAAA
题目名称 时钟 最终得分 100
用户昵称 GravatarConanQZ 是否通过 通过
代码语言 Pascal 运行时间 2.159 s
提交时间 2016-06-05 19:05:16 内存使用 0.17 MiB
显示代码纯文本
var
a:array[1..9,1..9]of longint;
w,x:array[1..9]of longint;
k,j,i1,i2,i3,i4,i5,i6,i7,i8,i9:longint;

procedure int;
begin
a[1,1]:=3; a[1,2]:=3; a[1,4]:=3; a[1,5]:=3;
a[2,1]:=3; a[2,2]:=3; a[2,3]:=3;
a[3,2]:=3; a[3,3]:=3; a[3,5]:=3; a[3,6]:=3;
a[4,1]:=3; a[4,4]:=3; a[4,7]:=3;
a[5,2]:=3; a[5,4]:=3; a[5,5]:=3; a[5,6]:=3; a[5,8]:=3;
a[6,3]:=3; a[6,6]:=3; a[6,9]:=3;
a[7,4]:=3; a[7,5]:=3; a[7,7]:=3; a[7,8]:=3;
a[8,7]:=3; a[8,8]:=3; a[8,9]:=3;
a[9,5]:=3; a[9,6]:=3; a[9,8]:=3; a[9,9]:=3;
end;

function check:boolean;
var
i:longint;
begin
for i:=1 to 9 do if x[i]<>12 then exit(false);
exit(true);
end;

procedure secceed;
var
j:longint;
begin
 for j:=1 to i1 do write('1 ');
 for j:=1 to i2 do write('2 ');
 for j:=1 to i3 do write('3 ');
 for j:=1 to i4 do write('4 ');
 for j:=1 to i5 do write('5 ');
 for j:=1 to i6 do write('6 ');
 for j:=1 to i7 do write('7 ');
 for j:=1 to i8 do write('8 ');
 for j:=1 to i9 do write('9 ');
 halt;
end;

begin
//assign(input,'11.in'); reset(input);
assign(input,'clocks.in'); reset(input);
assign(output,'clocks.out'); rewrite(output);
int;
for j:=1 to 9 do read(w[j]);
for i9:=0 to 4 do
for i8:=0 to 4 do
for i7:=0 to 4 do
for i6:=0 to 4 do
for i5:=0 to 4 do
for i4:=0 to 4 do
for i3:=0 to 4 do
for i2:=0 to 4 do
for i1:=0 to 4 do
  begin
   for j:=1 to 9 do x[j]:=(w[j]+a[1,j]*i1) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[2,j]*i2) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[3,j]*i3) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[4,j]*i4) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[5,j]*i5) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[6,j]*i6) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[7,j]*i7) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[8,j]*i8) mod 12;
   for j:=1 to 9 do x[j]:=(x[j]+a[9,j]*i9) mod 12;
   for j:=1 to 9 do if x[j]=0 then x[j]:=12;
   {if (i1=0)and(i2=0)and(i3=0)and(i4=1)and(i5=1)and(i6=0)and(i7=0)and(i8=1)and(i9=1) then
     begin
      for j:=1 to 9 do write(x[j],' ');
     end; }
   if check then secceed;
  end;
end.