比赛 |
NOIP_2 |
评测结果 |
AAAAAAAAAA |
题目名称 |
到天宫做客 |
最终得分 |
100 |
用户昵称 |
卐祭司卐 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-09-08 21:32:35 |
显示代码纯文本
program ex;
const
day:array[1..12] of integer=(31,29,31,30,31,30,31,31,30,31,30,31);
var
n,i:longint;
max,temp:longint;
t:longint;
f1,f2:text;
a:array[1..366] of boolean;
procedure sta;
var
y,r,d:longint;
i,j:longint;
begin
assign(f1,'heaven.in');assign(f2,'heaven.out');
reset(f1);
for i:=1 to 366 do a[i]:=true;
readln(f1,n);
if n<>0 then begin
for i:=1 to n do begin
readln(f1,y,r);
d:=0;
if y>1 then for j:=1 to y-1 do d:=d+day[j];
d:=d+r;
a[d]:=false;
end;
end;
close(f1);
end;
begin
sta;
if n=0
then t:=24*3600
else begin
max:=0;
i:=1;
while i<=366 do begin
while (i<=366) and not a[i] do inc(i);
temp:=0;
while (i<=366) and a[i] do begin
inc(temp);
inc(i);
end;
if temp>max then max:=temp;
end;
t:=round(max*24*3600/366);
end;
rewrite(f2);
writeln(f2,t);
close(f2);
end.