ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1070. Local Time

cound any one help?I think my program is right,but it got WA.
Posted by Crisphean 22 Nov 2001 17:56
program Acm_1070;
  var
    t1,t2:real;
    a,b,c,d:longint;
    i,te:longint;
    t:array[1..2] of longint;
  begin
    for i:=1 to 2 do
      begin
        readln(t1,t2); t1:=t1*100; t2:=t2*100;
        a:=round(t1); b:=round(t2);
        c:=a mod 100; d:=b mod 100; a:=a div 100; b:=b div
100;
        t[i]:=(b*60+d)-(a*60+c);
        if t[i]<=0 then t[i]:=t[i]+1440
      end;
    te:=abs(t[1]-t[2]);
    for i:=-10 to 10 do
      if abs(te+i) mod 120=0 then
        begin
          writeln(abs(te+i) div 120);
          halt
        end
  end.