摘要:
不得不吐槽并查集的题太少了 1118: 1 //一道并查集查询的题目 2 //需要注意的几个点 3 //输入的时候在进行合并时,是一个一个输入的,所以需要引入一个变量来存储前一个输入的值(j!=1) 4 //本题还要求输出树的数量和鸟的数量 5 //那就统计有多少只鸟,用q记录 6 //在查询鸟所在 阅读全文
posted @ 2022-11-24 16:26
江上舟摇
阅读(26)
评论(0)
推荐(0)
摘要:
1043: 1 //代码量较大的一道题,但还是考的BST的基本操作 2 //这道题要求判断原始序列是同先序序列相同还是与镜像先序序列相同,所谓镜像就是交换左右子树,只要在遍历的时候 3 //先遍历右子树在遍历左子树就可以解决这个问题了 4 //需要注意的一点是在插入的时候如果插入键值x小于节点的键值 阅读全文
posted @ 2022-11-24 16:24
江上舟摇
阅读(29)
评论(0)
推荐(0)
摘要:
1032: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); 4 #define int long long 5 co 阅读全文
posted @ 2022-11-24 16:19
江上舟摇
阅读(31)
评论(0)
推荐(0)
摘要:
1003: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define int long long 4 #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); 5 co 阅读全文
posted @ 2022-11-24 16:17
江上舟摇
阅读(26)
评论(0)
推荐(0)
摘要:
图的判断: https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805351814119424 https://pintia.cn/problem-sets/994805342720868352/exam/proble 阅读全文
posted @ 2022-11-24 15:46
江上舟摇
阅读(11)
评论(0)
推荐(0)

浙公网安备 33010602011771号