2022年1月13日
摘要: 1.快速排序 #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int a[N], n; void quickSort(int l, int r){ int key = a[(l + r) / 2], i = 阅读全文
posted @ 2022-01-13 23:01 Hamine 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://codeforces.com/problemset/problem/1591/D 题目大意: 给定一个长度为 \(n\) 的序列,可以选择其中的一个三元组 \((i, j, k)\),按顺序移动 \(i -> j -> k -> i\),可以进行任意次该操作,判断是否能使 阅读全文
posted @ 2022-01-13 23:00 Hamine 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://www.luogu.com.cn/problem/P1908 题目大意: 给长为 n 的序列,求序列中逆序对的数目 思路: 一、 归并: #include <bits/stdc++.h> using namespace std; #define LL long long 阅读全文
posted @ 2022-01-13 16:31 Hamine 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 单点修改,区间查询 #include <bits/stdc++.h> using namespace std; using LL = long long; struct Fenwick{ int n; vector<int> a; Fenwick(int n) : n(n), a(n + 1) {} 阅读全文
posted @ 2022-01-13 12:18 Hamine 阅读(68) 评论(0) 推荐(0) 编辑