I was solving problem link . My code runs fine on my other compilers. But It fails on same testcases on CF online Judge. Here is my solution link.[submission:112599418][submission:112599418] In the code, at one line I had checked if a double is integer or not. I am not able to figure out why is it happening so. Please help.
Uh i don't think its a reliable check, you should check against floor as well. ceil(1+1e-10)=2. Inconsistency is probably caused by excess precision which is enabled by default on 32 bit mingw.
Oh yes. Now I have changed my ceil() function to round(). And my solution is accepted.
But still my old code link was able to pass first testcase on other compiler but fail on online judge.
As i said most normal ppl have 64bit compilers. gnu c++17 is the 32 bit mingw version with excess precision. MinGW is such a mess idk if its a cf problem or all mingw 32 versions problem