记录编号 1987 评测结果 AAAAAAAAAA
题目名称 到天宫做客 最终得分 100
用户昵称 GravatarNickName 是否通过 通过
代码语言 Pascal 运行时间 10.000 s
提交时间 2008-09-10 20:20:41 内存使用 0.00 MiB
显示代码纯文本
program heaven;
const month:array[1..12] of integer=(31,29,31,30,31,30,31,31,30,31,30,32);
var hi,ho:text;
cash:array[1..367,1..2] of integer;
x1,x2:longint;
n:longint;
jg:real;
ls:integer;
t:integer;
temp:integer;
procedure pai;
var xx1,xx2:integer;
begin
for xx1:=1 to n-1 do
for xx2:=xx1+1 to n do
if ((cash[xx2,1]<cash[xx1,1]) or ((cash[xx2,1]=cash[xx1,1]) and (cash[xx2,2]<cash[xx1,2]))) then
begin
temp:=cash[xx1,1];
cash[xx1,1]:=cash[xx2,1];
cash[xx2,1]:=temp;
temp:=cash[xx1,2];
cash[xx1,2]:=cash[xx2,2];
cash[xx2,2]:=temp;
end;
end;
begin
assign(hi,'heaven.in');
reset(hi);
readln(hi,n);
if n=0 then jg:=366 else jg:=0;
for x1:=1 to n do
readln(hi,cash[x1,1],cash[x1,2]);
pai;
cash[x1+1,1]:=12;
cash[x1+1,2]:=32;
close(hi);
ls:=0;
t:=1;
for x1:=1 to 12 do
for x2:=1 to month[x1] do
begin
if (cash[t,1]=x1) and (cash[t,2]=x2) then
begin
if ls>jg then jg:=ls;
ls:=0;
t:=t+1;
end
else
ls:=ls+1;
end;
jg:=jg*24*3600/366;
assign(ho,'heaven.out');
rewrite(ho);
writeln(ho,round(jg));
close(ho);
end.