Блог пользователя lovrebuca

Автор lovrebuca, история, 3 года назад, По-английски

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
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 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.