Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么我把C++翻译过来后超时了?而C++能AC?

Posted by 568082880 at 2015-05-11 08:06:38 on Problem 1006
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator