Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) C】 Travelling Salesman and Specia
数位dp预处理1-1000中经过刚好经过k-1次变换到1的数. 然后搞一个数位dp, 当limit为false的时候可以在后面用组合数放置1. 要特判k==0(只有1满足)k==1(1不满足要减去)#include using namespace std;vectorint> vec;templateclass T>T read(){ T x = 0, f = 1;