Similarly in case of printf since the problem states in the "Output section : Your answer will be considered correct if the absolute error is less than 10-6 " thus .6Lf would also give a WA.
@admin could the above reasons be why people are facing WA issues.
Even i faced the same problem.
If you use just double data type in C and print answer using %lf by default it gives precision upto 10^-6 but i still don’t know why it was showing wrong answer on my first 3 submission and when i changed %lf to %.8lf(i took precision upto 8 digits) it showed me AC so there was some problem with the precision.
for ex.
if the real answer is something like…
1.666666666666…
your desired answer gives you value like
1.6666666666667
and my answer is
1.666667
which equals to 3.33 * 10^-7 which is clearly less than 10^-6.
by using only %lf you can never get absolute error of more than 5 * 10^-7.
my user id is : acm17in2673(in case anyone wants to check my submissions)
Because of this problem 2 hours increased in my total time in rankings. It can make me ineligible to qualify for regionals as in that time some of my college mates solved it with higher precision.
(I was 1st in my college after solving 2 questions and ended up at 3rd position after contest)
Our code gives same output as the expected output for sample input mentioned by admin above, still we got WA. @admin Please check. Team id: acm17in1024
Our code gives the correct output for the above mentioned test case and even with all other test cases. Our submission with id, 16113398, gives WA during the contest. @admin, Please look into this issue.
PS: While calculating the absolute error of our answer, consider the full answer with more than six places after the decimal as the expected answer and not the truncated one.
I checked my AC code against my own WA code and found no differences on all possible inputs (1-1e9,1-1e9) took a while to run but I still don’t know how and why it shows WA
Last year, a even serious fuck-up happened where teams claimed that they were logged out, couldnt access contest in last half and hour. Not sure how true it is, or how exaggerated, but thing is, such a serious thing happened- and no re-contest was held afaik.
Hm… The thing to notice here is that the absolute error here > 10^{-6}, but the relative error (obviously) is < 10^{-6}. So, can problem setter explain his intention behind why he chose his checker based on absolute error and not relative error? Clearly, all problems, which demands a certain degree of precision always chose to judge their solution on basis of relative error which is \frac{|A - B|}{max(1, A)}. My team was not affected, but we just got lucky I guess. To me, it seems ignorant on the problem setters part.
@vijju123 Then its the case of complier dependent problems. And you simply can’t judge someone to be wrong because different compilers have different judge environment. Codeblocks is used by many people and you can’t claim there answer to be wrong and codechef ide’s answer to be correct- Considering the fact that it will hamper the chances of teams qualifying to the next level.
@satyroxx1397 , firstly I am not judging anything. But frankly, you ARE responsible to make sure your code doesnt suffer from environment differences. Codeblocks does a lot of refinements to your code like initializing values to 0 by default, which arent done by codechef environment. If codeblocks give correct output but codechef gives different, then you are responsible to make it correct on codechef.
I requested @admin to go through it herself and consider case sympathetically, even though whether his code gets AC or WA is none of my concern.