bzoj4059.cc
#include #include #include #include using namespace std; typedef pair <int, int> ipr; typedef map <int, int> imap; typedef imap :: iterator imap_it; struct seg { int l, r, s, a; seg *ls, *rs; }; struct oper { int x, ya, yb, t; }; inline bool operator <(const oper& a, const oper& b) { return a. x < b. x; } const int maxn = 400009; int n, m, a[maxn], pr[maxn], su[maxn], t; oper o[maxn]; seg sbuf_arr[maxn * 2], *sbuf, *rt; imap ri;...