网站首页
编程语言
数据库
系统相关
其他分享
编程问答
SNCPC2019
2024-08-23
P9640 [SNCPC2019] Digit Mode
思路:定义\(F(l,r)\)表示若已经确定了\([1,l-1]\)的数,且\([l,r]\)没有限制的贡献数。设\(n\)的长度为\(len\),考虑先求出\([1,i](i\lelen-1)\)的贡献(是没有限制的),那么每次枚举第\(1\)位数字\(a_1\in[1,9]\),算上\(F(2,i)\)的贡献即可。则该情况贡献和为:\[\su
2024-05-27
P9650 [SNCPC2019] Escape Plan
原题链接第一份代码#include<bits/stdc++.h>#definelllonglongconstllmaxs=2e18;usingnamespacestd;lle[1000005];lld[1000005];structnode{llto,len;booloperator<(constnode&b)const{returnb.len>len;}};