04 2022 档案

摘要:1346. 回文平方 #include <iostream> #include <algorithm> #include <cstring> using namespace std; char get(int x) // 将x转化为b进制 { if(x <= 9) return x + '0'; r 阅读全文
posted @ 2022-04-18 22:11 Tshaxz 阅读(26) 评论(0) 推荐(0) 编辑
摘要:13. 找出数组中重复的数字 class Solution { public: int duplicateInArray(vector<int>& nums) { if(nums.empty()) return -1; unordered_map<int, int> hash; int n = nu 阅读全文
posted @ 2022-04-16 22:08 Tshaxz 阅读(16) 评论(0) 推荐(0) 编辑
摘要:AcWing PAT甲级树专题 1476. 数叶子结点 #include <iostream> #include <cstring> using namespace std; const int N = 110; int h[N], e[N], ne[N], idx; int n, m; int c 阅读全文
posted @ 2022-04-15 21:55 Tshaxz 阅读(46) 评论(0) 推荐(0) 编辑
摘要:学习资料 1.单调栈知识 2.算法讲解052【必备】单调栈-上 口诀:大增小减,左从左到右,右从右到左 解释:找某个元素左边或右边第一个比它大的元素,构造单调递增栈,遍历顺序与前面左右相同,要找左边就从左到右遍历,要找右边就从右到左遍历; 找某个元素左边或右边第一个比它小的元素,构造单调递减栈,遍历 阅读全文
posted @ 2022-04-12 18:42 Tshaxz 阅读(34) 评论(0) 推荐(0) 编辑

Language: HTML
点击右上角即可分享
微信分享提示