数据是不是有问题,我这居然过了?

P1618 三连击(升级版)

NOEND @ 2017-05-17 22:28:20

 var s:set of 1..9;
  a,b,c,d,i:longint;
procedure delete(n:longint);
  begin
   s:=s-[n mod 10];
   s:=s-[n div 10 mod 10];
   s:=s-[n div 100];
    end;
    begin
   read(a,b,c);
   s:=[1..9];
   d:=0;
    if (a<b) and (b<c) then
      for i:=123 to 765 do
       if (trunc(i/a*b)=i/a*b) and (trunc(i/a*c)=i/a*c) then
        begin
          delete(i);
          delete(trunc(i/a*b));
          delete(trunc(i/a*c));
          if (s=[]) and ((i/a*b)<=987) and ((i/a*c)<=987)then begin
      writeln(i,' ',trunc(i/a*b),' ',trunc(i/a*c));
      inc(d);
      end;
      s:=[1..9];
      end;
   if d=0 then write('No!!!');
end.

by NOEND @ 2017-05-17 22:31:11

输入是327 654 981时,

输出是192 384 576

219 438 657

273 546 819

327 654 981。。。。。。


|