上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int p[N], sz[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return p[x 阅读全文
posted @ 2022-05-02 21:28 wKingYu 阅读(29) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int p[N]; int find(int x) { if (p[x] != x) p[x] = find(p[x]); return p[x]; } in 阅读全文
posted @ 2022-05-02 20:54 wKingYu 阅读(33) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; const int M = 5e6 + 10; int son[M][2], idx; int a[N]; void insert(int x) { int 阅读全文
posted @ 2022-05-02 20:04 wKingYu 阅读(52) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 6e5 + 10; int son[N][26], cnt[N], idx; char str[N]; void insert(char str[]) { int p = 0; 阅读全文
posted @ 2022-05-02 17:15 wKingYu 阅读(45) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; const int M = 1e6 + 10; int ne[N]; int main() { int n, m; char p[N], s[M]; cin 阅读全文
posted @ 2022-05-02 16:35 wKingYu 阅读(30) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e6 + 10; int a[N], q[N]; int main() { int n, k; scanf("%d %d", &n, &k); for (int i = 0; 阅读全文
posted @ 2022-04-30 17:02 wKingYu 阅读(47) 评论(0) 推荐(1)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int stk[N], tt = 0; int main() { int n; scanf("%d", &n); while (n --) { int x; 阅读全文
posted @ 2022-04-30 16:14 wKingYu 阅读(36) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int q[N]; int l = 0, r = 0; void push(int x) { q[r] = x; r ++; } void pop() { l 阅读全文
posted @ 2022-04-30 00:37 wKingYu 阅读(34) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> #include<stack> #include<cstring> #include<unordered_map> using namespace std; stack<int> nums; stack<char> op; unordered_ma 阅读全文
posted @ 2022-04-30 00:29 wKingYu 阅读(48) 评论(0) 推荐(0)
摘要: 点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int s[N], idx = 0; void push(int x) { s[idx] = x; idx ++; } void pop() { idx -- 阅读全文
posted @ 2022-04-29 23:26 wKingYu 阅读(34) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 26 下一页