Page 6 of 6

Re: 362 - 18,000 Seconds Remaining

Posted: Thu Sep 29, 2016 3:04 am
by Filipe Herculano
Hi dudes, remember that when you are doing a division, you are losing some data. And as we don't know which test case is The Tricky one, we should not trust so much on divisions. For example, I received 3 WA before changing a silly thing.

-> This code below was receiving WA:

Code: Select all

printf("%d seconds\n", (int)ceil(bytes/(sum/5.0)));
-> This code passed right away.

Code: Select all

printf("%d seconds\n", (int)ceil((bytes * 5.0)/sum));
The difference between the two is simple: I'm not doing two divisions, just one! Somewhere deep down in the card tests there is one little motherf*cker that is not going up one integer and stays at the wrong answer.

Hope you guys passed after this!