2021辽宁大学生程序设计省赛完美主义(线段树)
题目链接++++++++++++++++++++++++++++++++++
#include
#include
#include
using namespace std;
const int N = 3e5 + 10;
int n, q;
int a[N];
struct Node {
int l, r;
bool flag;
int mx, mn;
}tr[N * 4];
void pushup(Node &u, Node &l, Node &r)
{
u.mx = max(l.mx, r.mx);
u.mn = min(l.mn, r.mn);
if (l.flag&&r.flag&&l.mx <= r.mn)
u.flag = true;
else
u.flag = false;
}
void pushup(int u)
共有 0 条评论