PersonalCorpus 版 (精华区)
15752 2002-11-10 15:39:14 BigGuava
127 .PAS Accepted 30 ms 20 kb
var
i,j,k,n,t:integer;
c:array[0..9999] of boolean;
begin
{$IFNDEF ONLINE_JUDGE}
assign(input,'i127.txt'); reset(input);
assign(output,'o127.txt'); rewrite(output);
{$ENDIF}
readln(k); readln(n);
fillchar(c, sizeof(c), 0);
for i:=1 to n do begin
readln(j);
c[j]:=true;
end;
n:=2;
for i:=1 to 7 do begin
t:=0;
for j:=i*1000 to i*1000+999 do if c[j] then inc(t);
n:=n+t div k;
if t mod k >0 then inc(n);
end;
i:=9;
t:=0;
for j:=i*1000 to i*1000+999 do if c[j] then inc(t);
n:=n+t div k;
if t mod k >0 then inc(n);
writeln(n);
end.
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:6.407毫秒