随笔分类 -  Fenwick Tree

摘要:link Given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integ 阅读全文
posted @ 2020-07-06 04:16 feibilun 阅读(247) 评论(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 阅读(146) 评论(0) 推荐(0)
摘要:link 1. Fenwick Tree: #include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #include <cstring> #include <queue> #include 阅读全文
posted @ 2020-04-27 11:32 feibilun 阅读(103) 评论(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 阅读(156) 评论(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 阅读(153) 评论(0) 推荐(0)
摘要:Video by Tushar https://www.geeksforgeeks.org/binary-indexed-tree-or-fenwick-tree-2/ #include <bits/stdc++.h> # define LL long long using namespace st 阅读全文
posted @ 2020-02-26 11:36 feibilun 阅读(159) 评论(0) 推荐(0)