My double divsion operator blog helped in a Codeforces Contest

Правка en3, от thekushalghosh, 2020-04-27 10:24:16

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 sharing this with the community.

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

Теги #contest, #python, division, floor division

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский thekushalghosh 2020-04-27 22:31:16 3 Tiny change: 'I thought sharing t' -> 'I thought of sharing t'
en3 Английский thekushalghosh 2020-04-27 10:24:16 1 Tiny change: '-in-python/)\n\nToday' -> '-in-python)\n\nToday'
en2 Английский thekushalghosh 2020-04-27 10:04:08 69
en1 Английский thekushalghosh 2020-04-26 23:23:05 1293 Initial revision (published)