随笔分类 - 题
摘要:终于想起来发博客了,呃呃呃呃呃呃 这题不难,但要看到 1≤L≤R<231和R−L≤106。 我们可以考虑先把<216的素数先筛出来,然后再把区间里的合数筛光。 然后……就没有然后了。 上代码: #include <bits/stdc++.h> #define int long long using
阅读全文
摘要:又忘发博客了啊啊啊啊啊啊啊 马的遍历竟然现在才写…… 模板bfs。 #include<bits/stdc++.h> using namespace std; queue<int> _x,_y; int ma[405][405],dx,dy; int qx[8]={1,1,2,2,-1,-1,-2,-
阅读全文
摘要:小粉兔的楼下 #include<bits/stdc++.h> using namespace std; long long N,Ans=1; long long C,G[50]; long long qPow(long long b,long long e) { long long A=1; for
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; int num[12],len; long long l,r,dp[11][11][11][2][2][2][2]; long long f(int p,int a,int b,bool c,bool d,b
阅读全文
摘要:新鲜出炉的数位dp #include<bits/stdc++.h> using namespace std; long long a,b; long long ten[20],f[20]; long long cnta[20],cntb[20]; void solve(long long x,lon
阅读全文
摘要:以下内容摘自OI-Wiki 引子 数位dp是指把一个数字按照个、十、百、千等等一位一位地拆开,关注它每一位上的数字。如果拆的是十进制数,那么每一位数字都是 0~9,其他进制可类比十进制。 数位 DP:用来解决一类特定问题,这种问题比较好辨认,一般具有这几个特征: 要求统计满足一定条件的数的数量(即,
阅读全文
摘要:d_f_s 附赠双倍经验,好耶! 然后爆搜就行 #include<bits/stdc++.h> using namespace std; int T,n,ans,sum[25]; void dfs(int x)//x为出牌次数 { if (x>=ans) return; //顺子 int k=0;/
阅读全文

浙公网安备 33010602011771号