![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
qq_38140952
这个作者很懒,什么都没留下…
展开
-
PAT 1135 Is It A Red-Black Tree
这道题不用建树也可以写,先用搜索树排序得到中序遍历,用中序遍历和先序遍历搜一遍每个根节点到NULL叶子节点的黑色点个数即可 #include <bits/stdc++.h> using namespace std; vector <int > pre , in; map<int , int > Index; int sum = 0 , flag = 0; void build(int root , int l , int r , int black , int fa){原创 2021-03-10 20:05:41 · 77 阅读 · 0 评论 -
PAT 1014 waiting in line
** PAT 1014 waiting in line ** 调试了一天,后来才发现是题目看错了 Note that since the bank is closed everyday after 17:00, for those customers who cannot be served before 17:00, you must output Sorry instead. 是要在17:00来的才输出sorry,17:00后才服务完的即使服务到第二天都要服务完,不能输出sorry。** #includ原创 2021-03-10 20:00:31 · 101 阅读 · 0 评论