2019 Multi-University Training Contest 8 1003 Acesrc and Good Numbers ——数位DP求n使得1-n中d的数量=n
Thisway题意:f(d,x)f(d,x)f(d,x)表示1-x中d的出现次数。现在给你d,n,让你求最大的xusingnamespacestd;#definelllonglongllp[20],nex[20],a[20];intd;lldfs(intpos){if(pos=0?p[pos-2]:0ll)+(d=0?x-y:y-x)/18,1ll);ret=x;for(inti=1;i<20;i