摘要:
A Codeforces 204A简单的数位DP。从高位到低位扫一遍就可以了。 1 #include 2 #include 3 typedef long long LL; 4 const int maxn = 20; 5 LL p[maxn]; 6 7 LL DP(LL x){ 8 int bit[20], cnt = 0; 9 for(LL n = x; n; bit[cnt ++] = n%10, n/=10);10 if(cnt==1) return x - 1;11 LL ans = 9;12 for(int i = 2; i 0; i ... 阅读全文