Unusual behavior of floating point variables in "Traffic Lights"

Hi, I was trying to solve the problem Traffic Lights from codeforces round 29 I was able to solve the problem but can somebody explain how just changing the language from C++14 to C++17 causes a change in the verdict
Wrong Answer Solution
Accepted Solution