Editorial for Mock CCC '19 Contest 1 J2 - Froggo's Numbers
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Authors:
If we want to determine the how many integers are divisible by in the range of to , then lets represent this as a function, such that is equal to the number of integers that are divisible by greater than or equal to , and less than or equal to .
If we represent using the above definition, then realistically, (like a prefix sum array, or inclusion-exclusion principle) is the solution. However, if , then we end up having , which is invalid.
We can rewrite like so, where in division, decimals are truncated:
Comments
I can't read I need help : ^)