上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页
摘要: Gmiansi: polish project dataset method self-work C++中不能连等赋值 LC148 #include<bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode* ne 阅读全文
posted @ 2020-02-25 19:18 黑暗尽头的超音速炬火 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.LC 139 word Break BONUS: 将vector数值存储在unordered_set中去重 vector<string> vs; unordered_set<int> us(vs.begin(),vs.end()); vector通过值找元素只能用find(vector.begi 阅读全文
posted @ 2020-02-25 19:12 黑暗尽头的超音速炬火 阅读(101) 评论(0) 推荐(0) 编辑
摘要: BONUS:背水一战 vector push_back() pop_back() 都别忘了back rand()产生随机数用法,不需要参数,直接返回值就是int存起来就行,返回0-32765(数值可能有误,但总归是30000多)的数 map经验谈: 1.可以用find/count查找下标存在与否。c 阅读全文
posted @ 2020-02-24 21:47 黑暗尽头的超音速炬火 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1.LC300带main代码 #include<iostream> #include<cstring> #include<string> #include<bits/stdc++.h> using namespace std; //return the longest increasing sequ 阅读全文
posted @ 2020-02-23 20:06 黑暗尽头的超音速炬火 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 牛客小白赛 / leetcode双周赛: 知识点总结: 1.__builtin_popcount(r),算数字里有几个1 class Solution { public: vector<int> sortByBits(vector<int>& arr) { sort(arr.begin(), arr 阅读全文
posted @ 2020-02-23 10:23 黑暗尽头的超音速炬火 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1.LC366 a.struct / class 这两点在继承上有差别,是C++历史兼容的产物。日常使用中,struct最多有初始化函数,class可以定义更多细节 2.堆 堆==完全二叉树 #include<queue> 完全二叉树判断方式: 层序遍历,遇到第一个#(代表NULL空值)即为结尾的就 阅读全文
posted @ 2020-02-22 11:16 黑暗尽头的超音速炬火 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define int long long int factorial_recursion( int n ) { if( n<=0 ) { return 1; } else { return n * facto 阅读全文
posted @ 2020-02-21 22:40 黑暗尽头的超音速炬火 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 边牧 在镜花水月的仙境瑶池,虚无与飘渺为伍,幻境与泥淖同在,你是雷光雨电,亦是霹雳丰碑。在迷惘的环境中,当我向永恒开战,你就是我的军旗,最后一次,耽于情绪 阅读全文
posted @ 2020-02-21 22:39 黑暗尽头的超音速炬火 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1.和结构体结合的运算符重载 https://www.runoob.com/cplusplus/cpp-overloading.html 2. 阅读全文
posted @ 2020-02-20 22:36 黑暗尽头的超音速炬火 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1.LC 334 class Solution { public: bool increasingTriplet(vector<int>& nums) { int n=nums.size(); if(n<3) return false; //must initial or cannot compar 阅读全文
posted @ 2020-02-20 17:33 黑暗尽头的超音速炬火 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 30 下一页