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

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

Question — Submission. This is the second time this has happened in this week. In my compiler I am getting the jury's answer but in the judge ans my solution is different. Can anyone tell me why this is happening or how to fix it?

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

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

You can check the compiler version you are working with and also try to compile it on online compilers like ideone and see if it is still different.

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

Use explicit casting on line 33, sqrt returns a double. Make your code more robust by not introducing unreliable behaviours.

And if you really want to take risks, read the documentation (default behaviours, implicit conversions, operators priority, undefined behaviours ...).