|
|
back to boardPozhaluysta, 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" ? 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 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:13Please, explain me why the answer is 5? answer is 5, because max difference in time = 5 hours)) then all answers >5 , =5 ! Edited by author 28.09.2009 21:26 There should be min(12 - h, h) instead of min(h, 5), test: 01.00 00.00 00.00 03.00 Answer 2 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); } 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... 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 |
|
|