比赛 20101118 评测结果 AAATTTTTTT
题目名称 最终得分 30
用户昵称 make 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-18 10:20:38
显示代码纯文本
program eight;
var
 p:array [1..15] of longint;
 n,a,b,s:longint;
 f1,f2:text;
procedure init;
var i:longint;
begin
 assign(f1,'eight.in'); reset(f1);
 assign(f2,'eight.out'); rewrite(f2);
 readln(f1,n);
 for i:=1 to n do
  read(f1,p[i]);
 readln(f1);
 readln(f1,a,b);
 close(f1);
end;

function ok(x:longint):boolean;
var i:longint;
begin
 if x mod 8=0 then begin
  for i:=1 to n do
   if x mod p[i]=0 then begin
    ok:=false;
    exit;
   end;
  ok:=true;
 end
 else ok:=false;
end;

procedure play;
var i:longint;
begin
 s:=0;
 for i:=a to b do if ok(i)=true then s:=s+1;
end;

procedure print;
begin
 writeln(f2,s);
 close(f2);
end;

begin
 init;
 play;
 print;
end.