随笔分类 - dp-数位dp
摘要:【题目描述】 中国人喜欢数字6和8。特别地,一些人喜欢满足含有特定个数6和8的数。现在请求出,在区间[L,R]之间的第K大的含有X个6和Y个8的数。 【输入】 输入的第一行包括4个数字,L,R,X,Y。 接下来的一行给出该组数据的询问数Q。 接下来Q行中,每行有一个整数K。 【输出】 对于某个询问,
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+5; 4 int tot,e[20]; 5 long long c[20][20]; 6 int a,b; 7 template<class t>void re
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+5; 4 int tot,e[40]; 5 long long c[40][40]; 6 int l,r,k,b; 7 template<class t>voi
阅读全文
摘要:和诸位巨佬不同,蒟蒻如我,只能想到怎么统计不满足windy数条件的数 就是个爆搜 定义c[i][j][k]表示第i位且前一位为j,k表示是否满足条件 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+5; 4
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e3+5; 4 const int mod=1e9+7; 5 int n,m,mark; 6 char l[maxn],r[maxn]; 7 int numl,num
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 const int maxn=1e5+5; 6 int tot,e[15]; 7 int c[15][maxn]; 8 in
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 const int maxn=1e6+5; 6 int n,m; 7 int c[10][10]; 8 int tot,e[
阅读全文
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e6+5; 4 long long a,b; 5 long long ansa[15],ansb[15]; 6 int tot,e[15]; 7 long long
阅读全文

浙公网安备 33010602011771号