1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream> 
using namespace std;
long long n, a[200000], m=0;
int main ()
{
	cin>>n;
	cin>>a[0];
	for (int i=1; i<n; i++)
	{
		cin>>a[i];
	}
	
	for (int j=1; j<n; j++)
	{
		while (a[j]<=a[j-1])
		{
           a[j]=(a[j]*10)+9; m++;
		}
	}
	cout<<m;
	return 0;
}