随笔分类 - 

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页
摘要:终于想起来发博客了,呃呃呃呃呃呃 这题不难,但要看到 1≤L≤R<231和R−L≤106。 我们可以考虑先把<216的素数先筛出来,然后再把区间里的合数筛光。 然后……就没有然后了。 上代码: #include <bits/stdc++.h> #define int long long using 阅读全文
posted @ 2024-10-08 18:54 yzc_is_SadBee 阅读(8) 评论(0) 推荐(0)
摘要:又忘发博客了啊啊啊啊啊啊啊 马的遍历竟然现在才写…… 模板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,- 阅读全文
posted @ 2024-10-07 20:03 yzc_is_SadBee 阅读(12) 评论(0) 推荐(0)
摘要:小粉兔的楼下 #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 阅读全文
posted @ 2024-09-19 20:33 yzc_is_SadBee 阅读(26) 评论(0) 推荐(0)
摘要:#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 阅读全文
posted @ 2024-09-19 20:00 yzc_is_SadBee 阅读(32) 评论(0) 推荐(0)
摘要:新鲜出炉的数位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 阅读全文
posted @ 2024-09-19 19:29 yzc_is_SadBee 阅读(11) 评论(0) 推荐(0)
摘要:以下内容摘自OI-Wiki 引子 数位dp是指把一个数字按照个、十、百、千等等一位一位地拆开,关注它每一位上的数字。如果拆的是十进制数,那么每一位数字都是 0~9,其他进制可类比十进制。 数位 DP:用来解决一类特定问题,这种问题比较好辨认,一般具有这几个特征: 要求统计满足一定条件的数的数量(即, 阅读全文
posted @ 2024-09-19 18:57 yzc_is_SadBee 阅读(41) 评论(0) 推荐(0)
摘要: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;/ 阅读全文
posted @ 2024-09-18 20:22 yzc_is_SadBee 阅读(12) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页