摘要:
link class Solution { public: stack<string> stk; unordered_map<string,multiset<string>> mp; vector<string> findItinerary(vector<vector<string>>& ticke 阅读全文
摘要:
link class Solution { public: int findMaxValueOfEquation(vector<vector<int>>& points, int k) { deque<int> dq; int n=points.size(); int res=INT_MIN; fo 阅读全文
摘要:
link class Solution { public: bool canArrange(vector<int>& arr, int k) { unordered_map<int,int> cnt; for(int i:arr){ cnt[(i%k+k)%k]++; } if(cnt[0]&1) 阅读全文
摘要:
link class Solution { public: int findDuplicate(vector<int>& nums) { int slow=0; int fast=0; while(true){ slow=nums[slow]; fast=nums[nums[fast]]; if(s 阅读全文
摘要:
link referenct to @617280219 Sort and group edges by weight. In each step we process one group of edges Discard the edges whose ends are already conne 阅读全文
摘要:
link 每一位1的个数有三种状态,0,1,2,3(0) 用两个bit,low和high来记录这些状态。 class Solution { public: int singleNumber(vector<int>& nums) { int high=0; int low=0; for(int n:n 阅读全文
摘要:
link #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <cstring> #include <queue> #include <stack> # define 阅读全文
摘要:
link class Solution { public: const int mod=1E9+7; vector<long long> powerof26; string longestDupSubstring(string S) { int n=S.size(); powerof26.resiz 阅读全文
摘要:
环境搭建 https://fishc.com.cn/forum.php?mod=viewthread&tid=156177&highlight=MASM 在dosbox运行,首先需要mount c 文件所在文件夹 源程序文件夹中需要 LINK.EXE, MASM.EXE, ML.EXE, DOSXN 阅读全文
摘要:
Link class Solution { public: void sortColors(vector<int>& nums) { int low=0; int high=nums.size()-1; for(int i=0;i<=high;){ if(nums[i]==0){ swap(nums 阅读全文