上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: 插件下载 在Clion 的插件市场中下载 Single File Execution 这个插件即可 安装插件后,在界面里右键 然后会发现CMakeList里会多出来一行 然后roload 设置自动roload ps: 这里有个一劳永逸的方法,可以在设置里找到cmake,设置在修改之后自动加载,这样之 阅读全文
posted @ 2022-09-04 12:31 Tshaxz 阅读(1910) 评论(0) 推荐(0)
摘要: 判断某序列是否为BST的后序遍历 46. 二叉搜索树的后序遍历序列 class Solution { public: vector<int> seq; bool verifySequenceOfBST(vector<int> sequence) { seq = sequence; return df 阅读全文
posted @ 2022-09-03 11:23 Tshaxz 阅读(30) 评论(0) 推荐(0)
摘要: 高精度模板 加法 vector<int> add(vector<int>& A, vector<int>& B) // 高精度加法 { vector<int> C; int t = 0; for (int i = 0; i < A.size() || i < B.size(); i ++ ) { i 阅读全文
posted @ 2022-09-01 21:00 Tshaxz 阅读(32) 评论(0) 推荐(0)
摘要: M进制转N进制 3374. 进制转换2 #include <iostream> #include <algorithm> #include <cstring> #include <vector> using namespace std; int main() { int a, b; string s 阅读全文
posted @ 2022-08-07 21:01 Tshaxz 阅读(66) 评论(0) 推荐(0)
摘要: 3765. 表达式树 将给定的表达式树(二叉树)转换为等价的中缀表达式(通过括号反映操作符的计算次序)并输出。 /** * Definition for a binary tree node. * struct TreeNode { * string val; * TreeNode *left; * 阅读全文
posted @ 2022-08-05 16:53 Tshaxz 阅读(102) 评论(0) 推荐(0)
摘要: 151. 表达式计算4 写法一: #include <iostream> #include <stack> #include <unordered_map> using namespace std; stack<char> op; stack<int> num; int qmi(int a, int 阅读全文
posted @ 2022-08-05 15:42 Tshaxz 阅读(33) 评论(0) 推荐(0)
摘要: 周赛传送门 4500. 三个元素 本题可以学习的地方: 1.用map来存值和下标,map会自动排序 2.输出map中的元素可以先用vector存起来,然后输出vector中的元素 #include <iostream> #include <map> #include <vector> using n 阅读全文
posted @ 2022-07-31 15:55 Tshaxz 阅读(26) 评论(0) 推荐(0)
摘要: 题单:LeetCode链表 2. 两数相加 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) { 阅读全文
posted @ 2022-07-30 18:41 Tshaxz 阅读(27) 评论(0) 推荐(0)
摘要: 记录LeetCode 热题 HOT 100 代码 1. 两数之和 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> hash; for(int i 阅读全文
posted @ 2022-07-18 19:58 Tshaxz 阅读(672) 评论(0) 推荐(0)
摘要: 62. 丑数 class Solution { public: int getUglyNumber(int n) { vector<int> q(1, 1); int i = 0, j = 0, k = 0; while( -- n) // 循环 n - 1 次 { int t = min(q[i] 阅读全文
posted @ 2022-05-17 17:43 Tshaxz 阅读(33) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
Language: HTML