[[CQOI2011]动态逆序对][1]题解:将时间转化为一个维度以后就变成了一个三维偏序的问题,然后把删除改为反向插入,插入的时候记得统计每个点前面把它大的数加上后面比它小的作为新加入的逆序对。#include <bits/stdc++.h>
const int MAXN = 100000;
using namespace std;
int n,m;
int p[MAXN...
陌上花开题解:三维偏序的模板题目。关于三维偏序有很多的写法,之前考试的时候写过树套树,这次采用CDQ。。。CDQ代码短,跑的快。真香。#include <bits/stdc++.h>
const int MAXN = 500000;
using namespace std;
int n,k,top;
int ans[MAXN],C[MAXN];
struct node{
...