In one of the recent problems (Link), I got the right (expected) output in VS Code compiler but WA on cf (Link). I think this is due to comparing the long double values. I even tried using
(cur - check > 1e-15) and (fabs(cur - check) > 1e-15)
instead of
cur > check
but still did not work. Can someone please help? Thanks in advance.