[原创]HDU 5898&&2016 ACM/ICPC Asia Regional Shenyang Online/ odd-even number [数位DP]【动态规划】

2016-09-18 22:01:52 Tabris_ 阅读数：316

https://blog.csdn.net/qq_33184171/article/details/52578407

-----------------------------------------------------------.
odd-even number

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 125 Accepted Submission(s): 66

Problem Description
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
2
1 100
110 220

Sample Output
Case #1: 29
Case #2: 36

Source
2016 ACM/ICPC Asia Regional Shenyang Online

--------------------------------------.

LL dp[30][3][30][3];

LL dfs(int pos,int pre,int x,int limit,int status,int lengh)

↑上面3点都解决了 相信数位DP的题目就解决了。

--------------------------------.