2021.3.5
\(\mathcal{A}\)
template<int len> struct Bitree {
int c[len + 5];
inline void add(int x, int y) {
for (; x <= len; x += x & -x) c[x] = max(c[x], y);
}
inline int qry(int x) {
int ret = 0;
for (; x; x -= x & -x) ret = max(ret, c[x]);
return ret;
}
};
Bitree<5000> T1[505];
Bitree<505> T2[5505];//别合了,慢