|
|
Round(time) instead of Ceil(time) This is invalid test, but anyway 10 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 00:00:00 Answer: 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:27:56 00:27:56 00:27:56 00:27:56 00:27:56 I get Wa6. I don't know my error. Give me some test please. Edited by author 07.01.2017 13:53 if the "ss" answer equal 60, update to 0 and change mm = mm+1 :) Maybe, you know some tricks? input 6 00:00:00 00:00:01 00:00:02 00:00:03 00:00:04 00:13:00 AC output 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:16:46 perhaps you meant this test? 6 00:00:00 00:00:01 00:00:02 00:00:03 00:00:04 00:00:05 my output WA5 00:13:58 00:13:58 00:13:58 00:13:58 00:13:58 00:15:48 why 00:16:46? Can someone please explain this to me. See, kettles number 1 - 5 will drink coffee at the same time (00:13:58) and only in this time kettle number 6 may begin to boil water for himself ..... He will need 2:48 seconds for that. Why 2:48 ? ...... because in this time 200 ml water will be in the kettle with 20 degrees .... but kettle number 6 want 100 degrees in the main kettle .... then we take: deltaT = 100 - 20 = 80 C and P you know from statement m = 200 using formula from statement (deltaT = P * littleT / C * m) we will take that littleT = deltaT * C * m / P = 02:48 --- this is time that we need to boil water. Result : 00:13:58 + 00:02:48 = 00:16:46 What could be in this test? Can you give me some tests? Finally i got AC. I don't know my mistake, i just rewrote my code :) Can you give me any test? I have WA #6 too.But I couldn't find my mistake. My adres azat.1990@mail.ru Edited by author 15.09.2010 18:04 AC Edited by author 12.06.2013 17:10 There are some equal times in test, but "All students wake up at the different moments but during the same day, i.e. all times different and between 00:00:00 and 23:59:59" Check it, please. I don't understood one thing. So look at this test 2 00:00:00 00:00:00 In fact teakettle will be ready to 335.2 second. But if we round this answer, it will be 335, i.e. 00:05:35. And it seems that this correct answer. But to this time teakettle will not be ready! And this test 3 00:00:00 00:00:00 00:05:35 And what should we think? 1) The teakettle is ready to 00:05:35, so in this time it will be EMPTY and the third student will BEGIN to boil water in this time 00:05:35? So answer will be 00:05:35 00:05:35 00:08:23 2) Or we should think that in this situation teakettle will be ready EXACTLY in 335.2 second and the teakettle will be not empty and the third student just ADD water in 00:05:35? So answer will be 00:08:23 00:08:23 00:08:23 My AC program says that you should think in the first way!)) The answer is 00:05:35 00:05:35 00:08:23 Good Luck!)) My AC program print 00:08:23 00:08:23 00:08:23 in time 00:05:35 temperature less than 100 Maybe both variants are right No. Only the second answer is right. Thank you for good test :) Your tests are not correct. 1. Precision of 1e-10 seconds is enough to compare boil-time with wake-time. 2. If some guy wakes up at the same time the water is ready (I mean exact equality up to precision), the water is disposed to cups first. So he will fill up an empty tank in this case. 3. Output times after rounding them UP. It is not quite clear from problem statement, but it's the closest guess if we assume that drinking can start only at integer number of seconds. At least this approach gives AC. 4. Output rounded times modulo 24:00:00 (i.e. if cup is ready the next day, subtract 24 from HH). Please add test like this: 3 00:00:00 00:00:00 00:05:35 This test is incorrect ("All students wake up at the different moments") Something awful! Please give any tests!!! Just mistake with rounding the time. AC now! The problem says that they wake up in the same day (but in different time). But what if some dummies will have to wait until the midnight passes? I can output the time then, but it will lead to misunderstanding. Is it guaranteed, that they all shall be able to drink in the same day? No! You should check this situation, too! Some of them maybe will be able to drink tea after midnight! ) good luck!) What shall I use for these formulas. Is float or double precision enough for that, or perhaps I should use fractional arifmetics (represent fractions nominator and denominator)? I got AC with double precision!) Point 2: "If another student boils water already, he should add 200 ml of water in the teakettle" Point 3: "If another student boils water and the teakettle is full already ..."
And what is in the case if several students boil water already? I think I should read not "another student boils" but "the other students boil". Am I right? Edited by author 23.03.2005 21:48 The 3rd point of instruction was corrected. Thank you. But why wasn't the 2nd corrected too? By the way,"another students boil" is a grammar mistake. "The other students boil" is correct. I have AC after rejudge, but the problem statement was unclear to me when I've read it for the first time. Problem statement says " All students wake up at the DIFFERENT moments but during the same day" but in test #8 there are students that wake up simultaneously!!! This is bad problem, and stoobid Time is different? for(i=0;i<400000;i++){ //for each sec if(m!=0.0 && i!=0){ dt=((100.0-T)*C*m)/P; if(dt>1.0) dt=0.0; T+=P*1.0/(C*m); // dt=0.0; } if(fabs(T-100.0)<0.0000001 || T>100.0){ //zakipel j=(int)(m/200.0); out(i,j); if(MWait<=1000.0){ if(MWait==0.0){ m=0.0; T=20.0; } else{ m=MWait; MWait=0.0; T=20.0; T+=P*dt/(C*m); } } else{ m=1000.0; MWait-=1000.0; T=20.0; T+=(P*dt)/(C*m); }
} if(time[i]==1){//add new people if(m==1000.0){ MWait+=200.0; }else{ // printf("Dolili "); // out(i,1); T=(m*T+4000.0)/(m+200.0); m+=200.0; } } Sorry for my English. |
|
|