臭道人

2021年2月25日

2.25

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1272 小希的迷宫,第一个做的 并查集的环问题 merge 里面的fa==fb的时候会产生环 #include<iostream> #include<cstring> using namespace std; co 阅读全文

posted @ 2021-02-25 03:23 臭总 阅读(56) 评论(0) 推荐(0) 编辑

2021年2月19日

2.19

摘要: https://leetcode-cn.com/problems/predict-the-winner/submissions/ 预测赢家 ①暴力递归 class Solution { public: bool PredictTheWinner(vector<int>& nums) { return 阅读全文

posted @ 2021-02-19 01:42 臭总 阅读(12) 评论(0) 推荐(0) 编辑

2021年2月18日

2.18

摘要: https://leetcode-cn.com/problems/count-sorted-vowel-strings/submissions/ 统计字典序元音字符串的数目 解法① 可以参考这个 https://leetcode-cn.com/problems/count-sorted-vowel- 阅读全文

posted @ 2021-02-18 04:34 臭总 阅读(45) 评论(0) 推荐(0) 编辑

2.17

摘要: https://www.acwing.com/problem/content/3211/ z扫描 两种找规律: ① #include <iostream> using namespace std; const int N = 510; int a[N][N]; int main(){ ios::sy 阅读全文

posted @ 2021-02-18 01:38 臭总 阅读(41) 评论(0) 推荐(0) 编辑

2021年2月14日

2.14

摘要: 哈夫曼树: 最小堆: https://www.acwing.com/problem/content/150/ 合并果子 拓展题:282,2889 c写法: #include<iostream> using namespace std; const int N = 10010; int n; int 阅读全文

posted @ 2021-02-14 02:58 臭总 阅读(36) 评论(0) 推荐(0) 编辑

2021年2月9日

2.9

摘要: https://pintia.cn/problem-sets/16/problems/671 哈夫曼树 字典树做法: #include <cstdio> #include <cstring> #include <queue> using namespace std; int n,rc,c,d,num 阅读全文

posted @ 2021-02-09 08:06 臭总 阅读(64) 评论(0) 推荐(0) 编辑

2021年2月8日

2.8

摘要: https://pintia.cn/problem-sets/994805342720868352/problems/994805407749357568 完全二叉搜索树 参考慕课讲解: 值得注意的: ①double log(int n) 其实是数学里面的Lg(); 所以要做到 log2 n的话使用 阅读全文

posted @ 2021-02-08 01:22 臭总 阅读(192) 评论(0) 推荐(0) 编辑

2021年2月7日

2.7

摘要: https://pintia.cn/problem-sets/16/problems/666 建树和输出叶结点 一刷 尝试用向量解决 尝试用队列解决 把收藏夹里这个题的几个链接搞完 #include<iostream> #include<algorithm> using namespace std; 阅读全文

posted @ 2021-02-07 02:07 臭总 阅读(213) 评论(0) 推荐(0) 编辑

2021年2月6日

2.6

摘要: PTA学习数据结构之旅 树的同构 https://pintia.cn/problem-sets/15/problems/711 解法① #include<stdio.h> #define max 12 #define Null -1 struct node { char data; int left 阅读全文

posted @ 2021-02-06 22:56 臭总 阅读(96) 评论(0) 推荐(0) 编辑

2021年1月28日

1.28

摘要: 栈的应用,简单配对,map运用 https://leetcode-cn.com/problems/valid-parentheses/ 做题收获:①map.count()用法 ②stack.top(),stack.push(ch),stack.pop();区别于map[ch]不是map(ch); ③ 阅读全文

posted @ 2021-01-28 20:46 臭总 阅读(69) 评论(0) 推荐(0) 编辑

导航