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

Автор JigolKa, история, 5 месяцев назад, По-английски

https://codeforces.net/contest/1526/submission/276695133

It outputs YES YES NO on my computer but YES NO NO on codeforces, for the first test case.

Can somebody help me figure it out? Thanks

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

»
5 месяцев назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

Hey!

You should not use functions, which returns double, if you works with integers. Double converts to Int by removing float part and all doubles are stored with some precision. For e.g., if you make double x = 3, in fact it may be 2.999999999999999999999 instead of 3, so if u want convert it to Int, you will get 2, but not 3

pow() and log10() returns double, so it's better not to use them

You can find out more info about functions u use on cppreference.com

There is an example:

works good: 276247840

doesn't work: 276718137

and the difference is only in types: I used double instead of int in second case