摘要: 模板: #include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; int n, m, heap[MAXN]; int fa[MAXN], ls[MAXN], rs[MAXN], dis[MAXN]; bool d 阅读全文
posted @ 2023-07-05 22:51 zipzipzipper 阅读(37) 评论(0) 推荐(0)
摘要: 并查集模板: #include<bits/stdc++.h> #define Maxsize 100005//只需要改这里就可以 using namespace std; int fa[Maxsize],rankk[Maxsize]; inline void init(int n)//初始化 { f 阅读全文
posted @ 2023-06-18 21:13 zipzipzipper 阅读(16) 评论(0) 推荐(0)
摘要: 题目: 思路:新建一个数组或者哈希表,检查新输入的元素是否在里面,如果在就pass,如果不在就作为新元素存进去,最后输出即可 数组实现:60分,时间复杂度O(n^2),或者O(nlogn); #include<bits/stdc++.h> using namespace std; int main( 阅读全文
posted @ 2023-06-17 13:18 zipzipzipper 阅读(91) 评论(0) 推荐(1)