比赛 NOIP_2 评测结果 AAAAAAAAAA
题目名称 到天宫做客 最终得分 100
用户昵称 NOIer 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-09-08 19:57:40
显示代码纯文本
//Problem : Noip;
//Author  : CaiXinXiao;
//Way     : Moni;

Program Heaven;

Const
  MaxN  = 366;
  Inf   = 'heaven.in';
  Ouf   = 'heaven.out';

Var
  Value : Array[1..MaxN] of Boolean;
  Max   : Longint;
  n     : Longint;

Procedure Init;
  Var
    i,r:Longint;
    a,b:Longint;
  Begin
    assign(input,Inf); reset(input);
    assign(output,Ouf); rewrite(output);
    FillChar(Value,sizeof(Value),True);
    Readln(n);
  End;

Procedure Main;
  Var
    i,j:Longint;
    m,d,k:Longint;
  Begin
     FillChar(k,sizeof(k),0);
     For i:=1 to n do
        Begin
          Readln(m,d);
          For j:=1 to m-1 do
          Case j of
            1,3,5,7,8,10,12:k:=k+31;
            2:k:=k+29;
            4,6,9,11:k:=k+30;
            End;
          K:=k+d;
          Value[k]:=false;
          K:=0;
        End;
     For i:=1 to 366 do
     if Value[i] then
      Begin
        k:=k+1;
        if k>max then max:=k;
      End
        Else k:=0;
      Max:=round((max/366)*24*3600);
  End;

Procedure Print;
  Begin
    Writeln(max);
    close(input);
    close(output);
  End;

BEGIN
  Init;
  Main;
  Print;
END.