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

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

During Educational Codeforces Round 116 (Rated for Div. 2), I try to submit my solution for question c in c++20 when there were around 850 submissions. But due to some reason, I kept getting the wrong answers. When I submitted it in c++17, it got accepted. You can see my submissions. Kindly look into this matter, I want to point out the bug rather than focusing on anything else. MikeMirzayanov

  • Проголосовать: нравится
  • -24
  • Проголосовать: не нравится

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What is the difference between log(k)/log(2) and log2(k)? Because in B problem it gives wrong answer if I use first one.

»
4 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

Most likely the pow function here is the culprit. Even if both of its arguments are integers, it still works with non-integer types, so it sometimes causes precision issues. Source

Your solution would've worked if you had made a power function of your own. Or what you did, shifting from 64bit to 32bit compiler.