摘要: 题意:二叉树求两点LCA。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), 阅读全文
posted @ 2020-03-24 22:42 Somnuspoppy 阅读(94) 评论(0) 推荐(0) 编辑
摘要: A 题意:n是否能被k个不同的正奇数表示。 #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorithm> #include<string> #include<iostream> #in 阅读全文
posted @ 2020-03-24 22:16 Somnuspoppy 阅读(120) 评论(1) 推荐(0) 编辑
摘要: 题意:求BST中两点的最近公共祖先。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va 阅读全文
posted @ 2020-03-24 15:40 Somnuspoppy 阅读(111) 评论(0) 推荐(0) 编辑