| ||||||||||
| 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 | |||||||||
Re:优化后AC了……In Reply To:为什么我把C++翻译过来后超时了?而C++能AC? Posted by:568082880 at 2015-05-11 08:06:38 var p,e,i,d,x,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;
for x:=d+1 to 21252 do
if abs(x-p)mod 23=0 then
break;
while x<=21252 do
begin
if abs(x-e) mod 28=0 then
break;
inc(x,23);
end;
while x<=21252 do
begin
if abs(x-i) mod 33=0 then
break;
inc(x,23*28);
end;
writeln('Case ',k,': the next triple peak occurs in ',x-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