Haricane193's blog

By Haricane193, history, 4 years ago, In English

QuestionSubmission. 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?

  • Vote: I like it
  • -4
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.

»
4 years ago, # |
  Vote: I like it +7 Vote: I do not like it

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 ...).