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

HINT
Posted by DWED 1 May 2004 23:39
Before sending solution, just test it on this examples.
1) 23.42 01.14
   08.10 17.51
Answer: 4
2) 01.01 10.59
   04.23 04.22
Answer: 5
3) 12.00 15.00
   01.02 03.07
Answer: 0
4) 23.58 00.43
   22.27 03.10
Answer: 2
5) 12.00 15.00
   20.00 21.00
Answer: 1
6) 01.01 21.59
   04.23 11.22
Answer: 5

;)
Re: HINT
Posted by Homly 24 Jun 2004 18:54
Thank you very much!!!!
I've got AC!!
HAHA!!
DWED wrote 1 May 2004 23:39
Before sending solution, just test it on this examples.
1) 23.42 01.14
   08.10 17.51
Answer: 4
2) 01.01 10.59
   04.23 04.22
Answer: 5
3) 12.00 15.00
   01.02 03.07
Answer: 0
4) 23.58 00.43
   22.27 03.10
Answer: 2
5) 12.00 15.00
   20.00 21.00
Answer: 1
6) 01.01 21.59
   04.23 11.22
Answer: 5

;)
Re: HINT
Posted by Kraev Aleksey 30 Jul 2004 17:56
The test 3 is wrong.
Re: HINT
Posted by Kraev Aleksey 30 Jul 2004 17:57
Thank you  for others
Thanks
Posted by wap 23 Oct 2004 23:19
Thanks a lot! It helps me very much.

I don't usually plan before writing a program, so I made lots and lots of wrong algorithms. I use your test cases and I correct , correct and recorrect my algorithms. They are wrong and wrong on test 4, 2, 5,.. (your test cases). And I got AC on the 2nd submit! Thank you!
what is wrong?
Posted by VALERO 24 Oct 2004 03:08
6) 01.01 21.59
04.23 11.22
Answer: 5

why it is true?
what is wrong in my&
my program:

var xh1, xh2, yh1, yh2 : real;
    xm1, xm2, ym1, ym2 : real;
    k, km : longint;
begin
read(xh1, yh1, xh2, yh2);
xm1:=trunc(xh1*100) mod 100;
xm2:=trunc(xh2*100) mod 100;
ym1:=trunc(yh1*100) mod 100;
ym2:=trunc(yh2*100) mod 100;
if yh1<xh1 then yh1:=yh1+24;
if yh2<xh2 then yh2:=yh2+24;
xh1:=trunc(xh1);
xh2:=trunc(xh2);
yh1:=trunc(yh1);
yh2:=trunc(yh2);

k:=abs(trunc(0.5*(yh1-yh2+xh2-xh1+trunc( (ym1-ym2+xm2-xm1)/60) )) );

writeln(k);
end.
Re: HINT
Posted by Daniel 20 Dec 2005 20:33
Thank you a lot.
In your test 6 my program outputs 7.
I forgot that answer should be than 6.
But due to my formula (which,I hope, is correct)the answer
is 7.
Now I have AC.
Thanks!
Re: HINT
Posted by Neymanov Tural 22 Dec 2007 02:20
I couldn't get 1 thing for tests 2 and 6. why answer isn't 7?

if the real time of flight if 17, for 2 test and 14, for 6 test, then 17-7=10 and 14-7=7 (the differences of flights where time is "going back") and 17+7=24 & 14+7=21 (the differences of flights where time is "goting forward").

but if answer is 5 then 10+5=15 24-5=19 (<>) and 7+5=12 and 21-5=16. then wahy this test are true. I know that there must be something that I didn't saw so please help me.
thanks.
Re: HINT
Posted by Ildar Valiev 26 Mar 2009 01:12
I'm don't understand, how can it be:

12.00 15.00
01.02 03.07

It means, that in one way plane fly 3 hours, in other - 2 hours. But in terms said, that times differs not more than 10 minutes.
Re: HINT
Posted by BlackShark 2 Apr 2009 20:43
This test is INCORRECT! Read this post again.