链接:奇偶覆盖
题意:
思路:
扫描线模板,维护有一点区别,分别维护当前节点下被覆盖奇数次和偶数次的长度。然后离散化一下(注意把数字离散化实质上是把每一段区间看成一个点)。
代码:
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pii pair<int,int>
using namespace std;
const int maxn=1e5+5,mod=998244353;
int num[maxn << 1],cnt = 1,res = 0;
int n , x1 , x2 , y , y2;
int sum[maxn << 4];
ll len1[maxn << 4] , len2[maxn << 4] , len[maxn << 4];
struct node{
int x1 , x2 , y ,val;
}e[maxn << 1];
bool cmp(node a , node