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

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

Given two decimal numbers U and V if we write down all the numbers from U to V how many zeroes(0) we will write?Where U<=V<=10^9 For example if U = 100 and V = 105 then we have to write 100,101,102,103,104,105 There are total 7 zeroes therefore the result is 7. I was trying to find a pattern but i could not come up with any perfect solution :(

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

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

you don't need dp for this.. the number of zeroes between 10n and 10n + 1 - 1 = 9 * n * 10n - 1

Just wrote python script to find this, I'm very bad in number theory :(