hdu3555专题

HDU3555——Bomb(数位DP)

通常的数位dp可以写成如下形式: int dfs(int i, int s, bool e) {if (i==-1) return s==target_s;if (!e && ~f[i][s]) return f[i][s];int res = 0;int u = e?num[i]:9;for (int d = first?1:0; d <= u; ++d)res += dfs(i-1,

hdu3555 Bomb

Problem Description The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the curr