POJ3686 The Windy’s Description The Windy’s is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take different amount of hours in differe…
Link 题目大意:求给定一个区间内满足每一位的数相差大于\(2\)且没有前导零的数的个数. \(\text{Solution:}\) 我们可以按照数位\(dp\).设状态为当前要\(dp\)第\(pos\)位,上一位填的是\(pre,\)当前是不是顶到最大值\((fg)\),当前是不是有前导零. 那么我们可以获得一个转移:\(dp[pos][pre][fg][zero]\)由它的后面一位\(dp[pos-1][pre'][fg'][zero']\)转移而来.转移的时候,我们枚举可行的数,并改变…