上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页
摘要: link #include <iostream> #include <string> #include <vector> #include <algorithm> #include <climits> #include <cmath> using namespace std; int N, K, M 阅读全文
posted @ 2020-05-11 18:19 feibilun 阅读(138) 评论(0) 推荐(0)
摘要: link a b 相等等价于 a^b=0. 则问题转换为找一对i,j a[i]^...^a[j]=0. class Solution { public: int countTriplets(vector<int>& arr) { int n=arr.size(); vector<int> pre(n 阅读全文
posted @ 2020-05-10 21:04 feibilun 阅读(166) 评论(0) 推荐(0)
摘要: link class Solution { public: long mod = 100000000000007L; long head=1L; int distinctEchoSubstrings(string text) { int n=text.size(); unordered_set<lo 阅读全文
posted @ 2020-05-10 09:13 feibilun 阅读(104) 评论(0) 推荐(0)
摘要: link Fenwick Tree: class Solution { public: int n; int reversePairs(vector<int>& nums) { n=nums.size(); vector<int> copy=nums; sort(copy.begin(),copy. 阅读全文
posted @ 2020-05-09 17:58 feibilun 阅读(145) 评论(0) 推荐(0)
摘要: link int getint(){ int res=0; char c=getchar(); while(!(c>='0' && c<='9')) c=getchar(); while(c>='0' && c<='9'){ res=res*10+(c-'0'); c=getchar(); } re 阅读全文
posted @ 2020-05-09 08:23 feibilun 阅读(121) 评论(0) 推荐(0)
摘要: link int dis[500][500]; int cost[500][500]; int pre[500]; int mindis[500]; int mincost[500]; int inque[500]; int main(){ memset(dis,-1,sizeof(dis)); i 阅读全文
posted @ 2020-05-08 08:52 feibilun 阅读(125) 评论(0) 推荐(0)
摘要: link /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NUL 阅读全文
posted @ 2020-05-07 08:40 feibilun 阅读(121) 评论(0) 推荐(0)
摘要: link class Solution { public: struct Comp{ bool operator()(vector<int>& v1, vector<int>& v2){ return v1[0]+v1[1]>v2[0]+v2[1]; } }; int kthSmallest(vec 阅读全文
posted @ 2020-05-03 19:34 feibilun 阅读(128) 评论(0) 推荐(0)
摘要: link class Solution { public: int longestSubarray(vector<int>& nums, int limit) { int n=nums.size(); deque<int> maxdq; deque<int> mindq; int right=0; 阅读全文
posted @ 2020-05-03 12:49 feibilun 阅读(192) 评论(0) 推荐(0)
摘要: https://www.jvruo.com/archives/215/ https://www.renfei.org/blog/bipartite-matching.html 阅读全文
posted @ 2020-05-01 18:36 feibilun 阅读(76) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页