上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页
摘要: link #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <cstring> #include <queue> # define LL long long usi 阅读全文
posted @ 2020-04-25 07:52 feibilun 阅读(118) 评论(0) 推荐(0) 编辑
摘要: link #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <cstring> #include <queue> # define LL long long usi 阅读全文
posted @ 2020-04-25 07:51 feibilun 阅读(130) 评论(0) 推荐(0) 编辑
摘要: link Solution1 归并排序: class Solution { public: int reversePairs(vector<int>& nums) { mergesort(nums,0,nums.size()-1); return res; } int res=0; void mer 阅读全文
posted @ 2020-04-24 12:45 feibilun 阅读(150) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: int getMaxRepetitions(string s1, int n1, string s2, int n2) { int len2=s2.size(); int len1=s1.size(); vector<int> next(l 阅读全文
posted @ 2020-04-19 22:51 feibilun 阅读(89) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: int findMinFibonacciNumbers(int k) { vector<int> fibo; fibo.push_back(1); fibo.push_back(1); while(true){ int i=fibo[fib 阅读全文
posted @ 2020-04-19 17:28 feibilun 阅读(215) 评论(0) 推荐(0) 编辑
摘要: link #include <iostream> #define LL long long using namespace std; int N,K; int nextadd[100000]; int val[100000]; int helper(int head){ int cur=head; 阅读全文
posted @ 2020-04-15 21:07 feibilun 阅读(101) 评论(0) 推荐(0) 编辑
摘要: link 常规写法: #include <iostream> #include <vector> #include <cstring> #include <stack> #include <unordered_set> #include <queue> #include <cmath> #defin 阅读全文
posted @ 2020-04-14 18:41 feibilun 阅读(182) 评论(0) 推荐(0) 编辑
摘要: link class Twitter { public: typedef list<pair<int,int>>::iterator It; unordered_map<int,list<pair<int,int>>> usertotweet; unordered_map<int,unordered 阅读全文
posted @ 2020-04-13 15:31 feibilun 阅读(119) 评论(0) 推荐(0) 编辑
摘要: link 解法: 先DFS给每个节点一个id,然后可以获得每个节点这颗子树的区间(一定是连续的),这样就可以进行线段树的操作(单点修改,区间修改,和区间查询), #define LL long long const int maxn=50005; const int mod=1000000007; 阅读全文
posted @ 2020-04-13 11:18 feibilun 阅读(177) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: int N; vector<int> fen; vector<int> processQueries(vector<int>& queries, int m) { N=2*m; fen=vector<int>(2*m+1); vector< 阅读全文
posted @ 2020-04-12 22:13 feibilun 阅读(147) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 17 下一页