摘要: https://leetcode-cn.com/problems/remove-sub-folders-from-the-filesystem/comments/ 愚蠢的做法,但是学了字典树。 class Solution { public: vector<string> ans; struct T 阅读全文
posted @ 2022-01-21 22:01 Tsyxxxka 阅读(39) 评论(0) 推荐(0) 编辑
摘要: https://leetcode-cn.com/problems/maximum-sum-bst-in-binary-tree/ ##题解 ###关键点: 1、判断是否二叉搜索树 2、是的话拿到键值和 判断二叉搜索树可以通过比较当前节点,当前节点左子树最大值和当前节点右子树最小值来实现;键值和可以在 阅读全文
posted @ 2022-01-19 21:15 Tsyxxxka 阅读(38) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P2118 分析 枚举即可,因为L<=100。 #include <bits/stdc++.h> using namespace std; #define LL long long #define INF 0x3fffffff i 阅读全文
posted @ 2021-10-28 16:38 Tsyxxxka 阅读(386) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P2239 分析 先剥掉x层再做。特判n=1,2时。 #include <bits/stdc++.h> using namespace std; #define LL long long int main() { int n, 阅读全文
posted @ 2021-10-28 15:31 Tsyxxxka 阅读(139) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P2141 #include <bits/stdc++.h> using namespace std; #define LL long long int a[110]; int main() { int n,cnt=0; cin>>n 阅读全文
posted @ 2021-10-25 21:04 Tsyxxxka 阅读(184) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P7911?contestId=54994 #include <bits/stdc++.h> using namespace std; #define LL long long #define P pair<string,int> s 阅读全文
posted @ 2021-10-25 20:41 Tsyxxxka 阅读(749) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P7910?contestId=54994 分析 排序做成O(n)复杂度即可。 #include <bits/stdc++.h> using namespace std; #define LL long long struct s 阅读全文
posted @ 2021-10-24 21:29 Tsyxxxka 阅读(1107) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P7909?contestId=54994 分析 无。 #include <bits/stdc++.h> using namespace std; #define LL long long LL n,l,r; int main() { 阅读全文
posted @ 2021-10-24 18:44 Tsyxxxka 阅读(340) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1593/problem/D2 分析 枚举选中的n/2个数中最小的数,然后枚举大于其的数的所有因子,如果拥有某个因子的数的个数大于n/2,则选中,求符合条件的最大的因子即可。 #include <bits/stdc++.h> us 阅读全文
posted @ 2021-10-21 20:28 Tsyxxxka 阅读(26) 评论(0) 推荐(0) 编辑
摘要: https://codeforces.com/contest/1593/problem/D1 分析 求最大公因子。 #include <bits/stdc++.h> using namespace std; #define LL long long int t,n,a[45],d[45]; int 阅读全文
posted @ 2021-10-21 16:57 Tsyxxxka 阅读(29) 评论(0) 推荐(0) 编辑
levels of contents
点击右上角即可分享
微信分享提示