上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 欧几里得算法 #include<iostream> #include<cstdio> using namespace std; int x,y; int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b); } int lcm(int a,i 阅读全文
posted @ 2021-03-06 21:30 DReamLion 阅读(77) 评论(0) 推荐(0) 编辑
摘要: Luogu P3383线性筛素数 #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 100000010 using namespace std; template<typename T> inline void re 阅读全文
posted @ 2021-03-06 21:26 DReamLion 阅读(29) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 1000010 using namespace std; template<typename T> inline void read(T &x){ x=0;bool 阅读全文
posted @ 2021-02-23 11:57 DReamLion 阅读(27) 评论(0) 推荐(0) 编辑
摘要: code: #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #define maxn 500010 using namespace std; template<typena 阅读全文
posted @ 2021-02-22 19:52 DReamLion 阅读(32) 评论(0) 推荐(0) 编辑
摘要: SP1805 #include<iostream> #include<cmath> #include<cstdio> #include<cstdlib> #define maxn 100010 #define ll long long using namespace std; template<ty 阅读全文
posted @ 2021-02-17 22:54 DReamLion 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 洛谷P1886滑动窗口 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #define maxn 1000010 using namespace std; template<typename T> inl 阅读全文
posted @ 2021-02-17 22:49 DReamLion 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 区间加&区间求和 P3372【模板】线段树1 #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 400010 #define ll long long using namespace std; template<ty 阅读全文
posted @ 2021-02-16 18:05 DReamLion 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 单点修改&区间查询 #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 500010 using namespace std; template<typename T> inline void read(T &x){ 阅读全文
posted @ 2021-02-14 22:48 DReamLion 阅读(22) 评论(0) 推荐(0) 编辑
摘要: int nxt[maxn];//c++11中next用作数组名会CE nxt[1]=0; for(int i=2,j=0;i<=m;i++){ while(j&&b[i]!=b[j+1]) j=nxt[j]; if(b[i]==b[j+1]) nxt[i]=j+1; } for(int i=1,j= 阅读全文
posted @ 2021-02-10 22:59 DReamLion 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 匈牙利算法 #include<iostream> #include<cstdio> #include<cstdlib> #define maxn 20010 using namespace std; int n,m,e,u,v,ans=0; int mp[maxn][maxn],match[maxn 阅读全文
posted @ 2021-02-09 23:02 DReamLion 阅读(39) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页