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

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

Hello Codeforces community,

A few months ago, I had noticed a fact and had written a blog on how the Double division operator should be used for floor division instead of math.floor() in Python. This is because the single division operator behaves abnormally for very large numbers in Python, and thus math.floor() on them would work incorrectly.

Link to my blog.

Today in Codeforces Educational Round #86 Question C, I first submitted a solution in which I used the Single Division Operator in floor division and got WA. But then I realised the large constraints which could cause an error here, so on changing the single division operator to Double Division Operator, I got AC.

My WA Solution

My AC Solution

This is the first time my blog has helped me in a Codeforces contest, so I thought of sharing this with the community.

PS: Please visit the blog to know the insight I am talking about.

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

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

Well, yes, doubles have limited precision.