| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
为什么我把C++翻译过来后超时了?而C++能AC?var p,e,i,d,a,b,c,k:longint;
begin
while k=k do
begin
inc(k);
readln(p,e,i,d);
if (p=-1)and(e=-1)and(i=-1)and(d=-1) then
break;
a:=p;
b:=e;
c:=i;
if (abs(p-d) mod 23=0)and(abs(e-d) mod 28=0)and(abs(i-d)mod 33=0) then
begin
inc(p);
inc(e);
inc(i);
d:=1;
end
else
begin
p:=d+1;
e:=d+1;
i:=d+1;
d:=1;
end;
while ((abs(p-a)mod 23<>0)or(abs(e-b) mod 28<>0)or(abs(i-c) mod 33<>0))and(d<21252) do
begin
inc(p);
inc(e);
inc(i);
inc(d);
end;
writeln('Case ',k,': the next triple peak occurs in ',d,' days.');
end;
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator