摘要: 定义windy数:相邻数字的差至少是2的数,例如10不是windy数,而13是windy数。求给定区间中有多少windy数。区间端点范围为 [1, 2000000000]dfs写法#include <stdio.h>#include <string.h>#define N 10int dp[N][N],digit[N];int dfs(int pos,int last,int z,int f){ if(pos==-1) return 1; if(z&&!f&&dp[pos][last]!=-1) return dp[pos][last]; 阅读全文
posted @ 2012-08-02 17:32 BeatLJ 阅读(1022) 评论(0) 推荐(0) 编辑