I was solving the round #757(Div. 2), and finished problem B, and submitted my solution around one hour into the contest. I was pretty sure that my solution was correct and when submitting it, I got a wrong answer. It turned out that it was because I was using the C++20 complier instead of the C++17 which I usually use. At the end of the contest i submitted the code with the C++17 compiler and it turned out to be correct. I'd like if someone could look into that because i could have probably solved C if it wasn't for the bug that kept me stuck at problem B.
You lose precision when you cast
l
fromint
to thefloat
type. And narrowing conversions in C++ are implementation-defined. So, you were unlucky to know and use thefloat
type in competitive programming.For reference, these are the subs:
https://mirror.codeforces.com/contest/1629/submission/143696836
https://mirror.codeforces.com/contest/1629/submission/143697118
edit: see https://mirror.codeforces.com/blog/entry/78161