//poj2528贴海报(线段树离散化)
#include<cstring>
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn=100005; //要开10倍的数组,否则RE
bool hash[maxn];
int li[maxn],ri[maxn];
int cov[maxn<<4];
int a[maxn*3];
int cnt;
int BinSea(int key,int n) //二分查找所在的编号即离散后的位置号
{
int l=0,r=n-1;
while(l<=r){
int mid=(l+r)/2;
if(a[mid]==key) return mid;
else if(a[mid]<key) l=mid+1;
else r=mid-1;
}
return -1;
}
void Pushdown(int p) //将该区间的标记向子女节点传递
{
if(cov[p]!=-1){
cov[p<<1]=cov[p<<1|1]=cov[p];
cov[p]=-1;
}
}
/*
void Build(int p,int l,int r)
{
cov[p]=-1;
if(l==r) {return;}
int mid=(l+r)/2;
Build(p<<1,l,mid);
Build(p<<1|1,mid+1,r);
}
*/
void Update(int p,int l,int r,int x,int y,int c)
{
if(x&l
poj2528(贴海报)线段树离散化
最新推荐文章于 2025-01-15 15:00:48 发布