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

Who give me some tests?
Posted by ILYA 22 Jun 2006 17:16
Pozhaluysta, kto-nibud', dayte mne hot' kakie testy k zadache 1070! A to vse testi, kotoriye u menya yest' moya programma prohodit, no na teste #1 dayot nepravil'niy otvet!
I obyasnite, pochemu mozhet byt' test:
"12.00 15.00
01.02 03.07
Answer: 0" ?
Re: Who give me some tests?
Posted by AndrewSt 22 Jun 2006 20:58
Yes you Answer 0;
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: Who give me some tests?
Posted by pedmustdie(Vologda STU) 14 Aug 2006 20:32
Potomu chto okruglyaetcya do nulya (chisla celye)
Kstati ya poluchil AC no u menya bolshaya proga. Kto-nibud mojet obyacnit kak cdelat koroche?

[code deleted]

Edited by moderator 29.12.2006 09:12
Re: Who give me some tests?
Posted by Metallllllll 28 Dec 2006 20:12
AndrewSt wrote 22 June 2006 20:58
Yes you Answer 0;
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
Can you explain me why on test 6 -> answer is 5 ?

Edited by author 28.12.2006 20:13
Re: Who give me some tests?
Posted by chensqi 21 Dec 2008 08:19
my programe can pass all your tests#,but i WA at ural's test#1,why...?
does someone can help me?


#include <stdio.h>
main()
{
      int i,j,k;

      scanf("%lf%lf%lf%lf",&ch[1],&ch[2],&ch[3],&ch[4]);
      for(i=1;i<=4;i++)
      {
        time1[i]=(int)ch[i];
        time2[i]=ch[i]-time1[i];
        if((i==2 || i==4) && time1[i]<time1[i-1]) time1[i]+=24;
      }
      hour=time1[3]-time1[4]+time1[2]-time1[1];
      mini=time2[3]-time2[4]+time2[2]-time2[1];
      hour=abs(hour+mini*5.0/3.0);
      hour/=2;
      if(hour>5) hour=5;
      printf("%.0lf",hour);
}
Re: Who give me some tests?
Posted by ahmedov(NUUz_2) 15 Mar 2009 23:33
Please, explain me why the answer is 5?
Re: Who give me some tests?
Posted by Rafikov Ramil 28 Sep 2009 21:24
answer is 5, because max difference in time = 5 hours))

then all answers >5 , =5 !

Edited by author 28.09.2009 21:26
Re: Who give me some tests?
Posted by -XraY- 23 Dec 2010 22:22
test 3 is wrong. please, read the statement.
The time of flights there and back may differ from each other not more than by 10 minutes

if answer is one, the time of the first flight is 3 hours
and the second - 2 hours 5 minutes...
of course, those times differ by 55 minutes...
Re: Who give me some tests?
Posted by Nikita++ 15 Jul 2017 18:00
There should be min(12 - h, h) instead of min(h, 5), test:
01.00 00.00
00.00 03.00

Answer 2