ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1353. Milliard Vasya's Function

Easy Approach HINT
Posted by Sai Teja Chokkarapu 31 Jul 2020 12:42
-> think of doing this problem first -> count of n digits numbers whose sum is equal to x.
->First try to think for smaller numbers less than 1000 i.e from 1 to 999.
-> Create the tree for the same i.e numbers less than 999.
-> after finding f(n,sum)(n is the number of digits and sum is the required sum).
-> you can find f(9,sum)for all numbers less than 1000000000.
-> now finally you need to handle for one number 1000000000.
Cheers

Edited by author 31.07.2020 12:43