|
|
вернуться в форумHINT Послано DWED 1 май 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 Послано Homly 24 июн 2004 18:54 Thank you very much!!!! I've got AC!! HAHA!! 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 The test 3 is wrong. Re: HINT Thank you for others Thanks Послано wap 23 окт 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? Послано VALERO 24 окт 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 Послано Daniel 20 дек 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 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 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 This test is INCORRECT! Read this post again. |
|
|