Related
In following contests:
先跟着灵神学一下 数位dp
然后你就会了...
因为其实就是一个非常裸的数位dp。刷过哪怕一道数位dp的题,你就能够立马反应过来。
在模板的基础上做一个更改:dfs的过程中转移当前数位的最大值mx。递归出口返回mx即可。
定义f(d)为d的最大数位的值 例如:
f(1012)=max(1,0,1,2)=2
In following contests:
By signing up a CodeFun2000 universal account, you can submit code and join discussions in all online judging services provided by us.