摘要: 利用大根堆和小根堆的性质,进行维护, 大根堆的元素要一直小于GET的次数(也就是i),每一次操作后都要进行大根堆的元素增加 也就是p.push(q.top()), q.pop();这一步操作!!!!! #include <bits/stdc++.h>using namespace std; cons 阅读全文
posted @ 2022-10-29 13:05 feuerwerk 阅读(27) 评论(0) 推荐(0)
摘要: 1.归并排序方法求逆对 (方法相同于P1908 逆序对) #include<bits/stdc++.h>using namespace std; const int N = 5e5 + 7; int a[N], st[N];long long ans = 0;void merge_sort(int 阅读全文
posted @ 2022-10-29 10:13 feuerwerk 阅读(48) 评论(0) 推荐(0)