随笔分类 - pat甲级(Advanced Level)刷题记录
摘要:https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805447855292416 1 //需要注意的几个点 2 //字符串哈希的应用 3 //v.size的判断 4 //对于选课人员的序号升序排序 5 #includ
阅读全文
摘要:排序问题一般是给定一组数据让你根据规则进行排序,其中应用比较广的就是cmp排序规则和排名rank的计算 https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805474338127872 1 //需要注意的几个点 2
阅读全文
摘要:图的判断问题一般基于是给定一个场景或者是关于一个图的定义问题,然后输入一张图,给定一组数据要求判断这组数据是否是满足这个图的相关定义 比如给定一个哈密顿回路或者是最大团最小团问题或者是拓扑排序的问题 https://pintia.cn/problem-sets/994805342720868352/
阅读全文
摘要:https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805410555346944 https://pintia.cn/problem-sets/994805342720868352/exam/problems/994
阅读全文
摘要:https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805482919673856 https://pintia.cn/problem-sets/994805342720868352/exam/problems/994
阅读全文
摘要:1002: 1 //思路很简单,存哈希表直接计算就可以了 2 //需要注意的几个点 3 //求最高次数的时候判断当前的系数是否为0 4 //倒着输出的时候注意格式 5 #include<bits/stdc++.h> 6 using namespace std; 7 #define int long
阅读全文
摘要:不得不吐槽并查集的题太少了 1118: 1 //一道并查集查询的题目 2 //需要注意的几个点 3 //输入的时候在进行合并时,是一个一个输入的,所以需要引入一个变量来存储前一个输入的值(j!=1) 4 //本题还要求输出树的数量和鸟的数量 5 //那就统计有多少只鸟,用q记录 6 //在查询鸟所在
阅读全文
摘要:1043: 1 //代码量较大的一道题,但还是考的BST的基本操作 2 //这道题要求判断原始序列是同先序序列相同还是与镜像先序序列相同,所谓镜像就是交换左右子树,只要在遍历的时候 3 //先遍历右子树在遍历左子树就可以解决这个问题了 4 //需要注意的一点是在插入的时候如果插入键值x小于节点的键值
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:图的判断: https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805351814119424 https://pintia.cn/problem-sets/994805342720868352/exam/proble
阅读全文
摘要:有点麻烦,有些知识点是盲点,留着明天学 题目: https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805377432928256 https://pintia.cn/problem-sets/994805342720
阅读全文
摘要:今天先整理二叉树,dijkstra和链表二刷过几天有空会整理 首先二叉树的几个性质就不说了,其中一个我认为比较好用的是满足二叉树连通,边数等于顶点数-1的结构就一定是一棵树 这次二刷的新的收获是分辨*root=NULL与root=NULL的不同之处,首先*root=NULL是不合法的 因为*root
阅读全文
摘要:https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805388447170560 https://pintia.cn/problem-sets/994805342720868352/exam/problems/994
阅读全文
摘要:pat: 模考58分,相较夏季赛差了不少 1.模拟 给定一个字符串,要求按照得分点和失分点进行模拟,求最后得分即可 模拟比较难写 参考小柳学渣大神的代码,大神码风和思路都很好 1 #include <bits/stdc++.h> 2 using namespace std; 3 int main()
阅读全文
摘要:不好做的重载题: https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805348471259136
阅读全文
摘要:https://pintia.cn/problem-sets/994805342720868352/exam/problems/1038430130011897856 建树+LCA跑图
阅读全文
摘要:1167:https://pintia.cn/problem-sets/994805342720868352/exam/problems/1478636026017230848 是一道裸题笛卡尔树,笛卡尔树具有键值和权值两个衡量标尺,键值满足complete tree,权值满足大(小)根堆的性质;并
阅读全文
摘要:暴力可过大部分,最后的超时是二分 https://pintia.cn/problem-sets/994805342720868352/problems/994805507225665536 没A,为了节省时间先做别的
阅读全文