### lovrebuca's blog

By lovrebuca, history, 4 months ago,

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.

• -19

 » 4 months ago, # |   0 You lose precision when you cast l from int to the float type. And narrowing conversions in C++ are implementation-defined. So, you were unlucky to know and use the float type in competitive programming.
•  » » 4 months ago, # ^ | ← Rev. 2 →   0 Please look at the warning https://imgur.com/a/WZfGyiOHere is the accepted solution with change. https://codeforces.com/contest/1629/submission/143708982
 » 4 months ago, # | ← Rev. 2 →   0 For reference, these are the subs:https://codeforces.com/contest/1629/submission/143696836https://codeforces.com/contest/1629/submission/143697118