该文被密码保护。 阅读全文
posted @ 2021-10-31 19:40 小白QIU 阅读(0) 评论(0) 推荐(0)
摘要: #include <iostream>#include <stdio.h>using namespace std;const int N=10;int n;int path[N];bool st[N];void dfs(int u){ if(u==n) { for(int i=0;i<n;i++) 阅读全文
posted @ 2021-10-31 14:35 小白QIU 阅读(45) 评论(0) 推荐(0)
摘要: #include <iostream>#include <stdio.h>using namespace std;typedef unsigned long long ULL;const int N=100010,P=131;int n,m;char str[N];ULL h[N],p[N];ULL 阅读全文
posted @ 2021-10-30 19:14 小白QIU 阅读(35) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int n,m;int main(){ for(int i=100000;;i++)//定以大于100000质数 { bool flag=true; for(int j=2;j*j<i; 阅读全文
posted @ 2021-10-30 14:43 小白QIU 阅读(35) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int n,m;int h[N],size;void down(int u){ int t=u; if(u*2<=size&&h[u*2]<h[t]) t=u*2; if(u*2+1<= 阅读全文
posted @ 2021-10-29 20:04 小白QIU 阅读(52) 评论(1) 推荐(0)
摘要: 并查集 1.将两个集合合并 2.询问两个元素是否在一个集合当中 基本原理,每个集合用一个树表示,树根的编号就是集合的编号,每个节点存储它的父节点,p[x]表示x的父节点 问题1.如何判断树根:if(p[x]==x) 问题2:如何求x的集合编号 while(p[x]!=x) x=p[x]; 问题3:如 阅读全文
posted @ 2021-10-22 20:29 小白QIU 阅读(30) 评论(0) 推荐(0)
摘要: #include <iostream>#include <stdio.h>using namespace std;const int N=10010;int son[N][26],cnt[N],idx;char str[N];void insert(char str[]){ int p=0; for 阅读全文
posted @ 2021-10-07 09:12 小白QIU 阅读(26) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010,M=100010;char s[M],p[N];int n,m;int ne[N];int main(){ cin>>n>>p+1>>m>>s+1; for(int i=2,j=0;i< 阅读全文
posted @ 2021-10-04 19:15 小白QIU 阅读(35) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int n,k;int a[N],q[N]; int main(){ cin>>n>>k; for(int i=0;i<n;i++) cin>>a[i]; int hh=0,tt=-1; 阅读全文
posted @ 2021-09-28 20:23 小白QIU 阅读(27) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;const int N=10010;int e[N],en[N],head,idx;void init(){ head=-1; idx=0;}void add_to_head(int x){ e[idx]=x; en[id 阅读全文
posted @ 2021-09-28 19:31 小白QIU 阅读(30) 评论(1) 推荐(0)