Wrong Judgement Regarding Compression Algorithm (ICPC 2017)

There’s a difference between using cout<< setprecision(x) and cout<< fixed<< setprecision(x) [reference- Please explain the difference between the two solutions ACM ICPC 2018 online round - Codeforces ].
SO people who dint use fixed would mostly have got a WA.

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.

2 Likes

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

so if i subtract your answer from my answer

1.6666670000000 - 1.6666666666667
= 0.000000333333

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. :frowning:
(I was 1st in my college after solving 2 questions and ended up at 3rd position after contest)

3 Likes

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.

1 Like

The same problem occured with code of my team. We got three penalties just for precision and we wasted a lot of time trying to find our mistake.

in question number 3 and we got internal error due to which our team get penalty…

Exactly, the time wasted could have been used for the 4th and 5th problem

3 Likes

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

4 Likes

We can still qualify for kharagpur site if this issue is solved so it is a request that @admin please look into the matter

6 Likes

hey, do drop a mail at help@codechef.com (just in case they publish results before looking at discuss)

3 Likes

already done

2 Likes

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.

3 Likes

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.

3 Likes

@admin we have tested our code on this particular test case in our local compiler(CodeBlocks).

Our output: 1819418087.764435

Expected output: 1819418087.764434

Our code gives output within the expected error bound

This is the screenshot of our local compiler with the given output.

Screenshot

5 Likes

I didnt get AC just bcoz i used setprecision(10), setprecision(20) is AC

2 Likes

@admin even our code (submission id: 16117083) gives correct output 1819418087.764435. But we got WA.

@aashrayagarwal ,can you check your code on codechef IDE and tell the results? Because codeblocks environment is different from judge environment.

@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.

1 Like

@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.

3 Likes

Rightly said @melody00. Or they could have avoided this issue altogether by asking us to print the fraction in reduced form (a/b where gcd(a,b)=1).

2 Likes