05 2021 档案

并查集我知不道
摘要:#include <iostream> using namespace std; int set[10]; int find(int x)//找x的祖先 { if(set[x]==x) return x; return set[x]=find(set[x]);//把x的各个祖先的双亲都置最久远的祖先 阅读全文

posted @ 2021-05-21 09:05 ewitt 阅读(43) 评论(0) 推荐(0)

kmp-getNext
摘要:#include <iostream> using namespace std; void getNext(char a[]){ int k=-1,i=0,next[10]; next[0]=-1; while(a[i]!='\0'){ if(k 1 || a[i]==a[k]){ next[++i 阅读全文

posted @ 2021-05-17 10:05 ewitt 阅读(60) 评论(0) 推荐(0)

vector存放边的方法
摘要:#include<bits/stdc++.h> using namespace std; struct Edge{ int x; int y; }; vector <Edge> G; //G[i]代表从i出发的边,vector里存的是边 int m,n; int temp; int main(voi 阅读全文

posted @ 2021-05-15 09:16 ewitt 阅读(184) 评论(0) 推荐(0)

标准库集锦
摘要:#include<bits/stdc++.h> using namespace std; #define MAX 200005 #define lson (p<<1) #define rson (p<<1|1) #define mid ((l + r) >> 1); typedef pair<int 阅读全文

posted @ 2021-05-14 13:33 ewitt 阅读(26) 评论(0) 推荐(0)

dev编译器兼容设置及字符串的识别问题
摘要:#include<bits/stdc++.h> using namespace std; bool cmp(char a,char b) { return a>b; } //int stoint(string s){ // int sum=0; // for( int i=0;i<s.length( 阅读全文

posted @ 2021-05-10 22:58 ewitt 阅读(171) 评论(0) 推荐(0)

导航