- 博客(2)
- 收藏
- 关注
原创 蓝桥杯2020省赛第二场七段码
位运算+并查集 ###思路:将每条边存到pair类型的vector中,使用位运算枚举所有边的选择情况,如果某条边被选中,就将边的两个端点置为被访问过,并加到一个集合中,处理完所有边后, 看所有被访问过的点是否都在同一个集合 #include <iostream> #include <cstring> #include <algorithm> using namespace std; typedef pair<int, int> PII; const int N
2021-05-31 09:15:11 76
原创 团体程序设计天梯赛 链表去重
思路:先用链表将所有的点串起来,再遍历链表,分别将原始表的和删除表中的节点分别存到两个结构体数组中 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1e5+10; struct Node { int ads; int value; }; int e[N],ne[N]; int had,n; bool st[N]; i
2021-04-23 14:30:05 61
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人