For a number,if the length of continuous odd digits is even and the length of continuous even digits is odd,we call it odd-even number.Now we want to know the amount of odd-even number between L,R(1<=L<=R<= 9*10^18).
Input First line a t,then t cases.every line contains two integers L and R. Output Print the output for each case on one line in the format as shown below.
Sample Input
Sample Output
题目大概:
在n和m之间存在多少个数,各位数之间有着连续奇数个偶数,偶数个奇数。
思路:
数位dp。
在递归里加几个条件,进行判断。
是否有前导零,是否有零。
前一个数是奇数,后一个是否是奇数,
前一个数是偶数,后一个是否是偶数,
最后判断一下,。
代码: