Time Limit | Memory Limit |
2000ms | 976MB |
Problem Statement
Mr. Infinity has a string S consisting of digits from 1
to 9
. Each time the date changes, this string changes as follows:
- Each occurrence of
2
in SS is replaced with22
. Similarly, each3
becomes333
,4
becomes4444
,5
becomes55555
,6
becomes666666
,7
becomes7777777
,8
becomes88888888
and9
becomes999999999
.1
remains as1
.
For example, if SS is 1324
, it becomes 1333224444
the next day, and it becomes 133333333322224444444444444444
the day a