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

Автор AnikaTahsin, история, 6 лет назад, По-английски

955C - Sad powers in this problem a very strange behavior of compiler had happened and i didn't understand why ?? :|

  1. 43417754
  2. 43417574
  3. 43414929

In the above submission links you can see that first one is submitted in GNU C++14 and second one is submitted in GNU C++17 and third one submitted in GNU C++11. But unfortunately first one got WA and second one got AC. 3rd submission also got WA but same code. can anyone tell me why this happened ?
Thanks.

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

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

That's because of builtin sqrt() function you are using. Try writing your own sqrt() function & see that your code gets Accepted in C++11 , C++14 & C++17