比赛 NOIP_2 评测结果 AAAAAAAAAA
题目名称 到天宫做客 最终得分 100
用户昵称 elysian 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-09-08 20:32:37
显示代码纯文本
program cc;
const
fin='heaven.in';fout='heaven.out';
var
a:array[1..366] of longint;
f:array[1..366] of boolean;
n,m,d,i,j,sum,max:longint;
f1,f2:text;


begin
assign(f1,fin);reset(f1);
readln(f1,n);
fillchar(f,sizeof(f),false);
for i:=1 to n do
 begin
  readln(f1,m,d);
  for j:=1 to m-1 do

     case j of
     1,3,5,7,8,10,12:sum:=sum+31;
     2:sum:=sum+29;
     4,6,9,11:sum:=sum+30;
     end;

    sum:=sum+d;
    f[sum]:=true;
    sum:=0;


end;
close(f1);

for i:=1 to 366 do
begin
if f[i]=false then
begin
inc(sum);
if sum>max then max:=sum;
end
else sum:=0;
end;
assign(f2,fout);rewrite(f2);
max:=round(max/366*24*3600);
writeln(f2,max);
close(f2);
end.