thekushalghosh's blog

By thekushalghosh, history, 4 years ago, In English

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.

  • Vote: I like it
  • +18
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +15 Vote: I do not like it

Well, yes, doubles have limited precision.