Programming problem from competition
@manish-r2Hoep
•
Oct 18, 2024
Oct 18, 2024
1.0K
here is a problem which i face when i participate in a online programming competition
can any any one solve it
Problem Statement:
Now comes an interesting math game.
How many of the numbers 2^m (0 <= m <= M),m is integer, have leading digit 1 in the decimal notation ?
Input:
There are multiple cases, end with EOF
each case have one integer, M. (0 <= M <= 10^15 )
Output:
Each case a line, the number of the numbers which have leading digit 1.
Sample Input
2
4
Sample Output
1
2
can any any one solve it
Problem Statement:
Now comes an interesting math game.
How many of the numbers 2^m (0 <= m <= M),m is integer, have leading digit 1 in the decimal notation ?
Input:
There are multiple cases, end with EOF
each case have one integer, M. (0 <= M <= 10^15 )
Output:
Each case a line, the number of the numbers which have leading digit 1.
Sample Input
2
4
Sample Output
1
2