If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2(both inclusive)? Note that you should take leap years into consideration. A leap year is a y…
If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2 (both inclusive)? Note that you should take leap years into consideration. A leap year is a…
How Many Nines Time Limit: 1 Second Memory Limit: 65536 KB If we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2 (both inclusive)? Note that…
1150. Page Numbers Time limit: 1.0 secondMemory limit: 64 MB John Smith has decided to number the pages in his notebook from 1 to N. Please, figure out the number of zeros, ones, twos, …, nines he might need. Input One number N (1 ≤ N < 109). Output…