摘要:
#include #include const int MAXN = 200005;typedef struct { int l; int r; int max;}Node;Node seg[MAXN * 4];int Max;int fmax(int x,int y){ return x > y ? x : y;}void build(int num,int l,int r){ seg[num].l = l; seg[num].r = r; seg[num].max = -1; if ( l == r ) return; i... 阅读全文
摘要:
#include #include const int MAXN = 100005;typedef struct { int cnt; int l; int r;}Node;Node seg[3 * MAXN];int ans[MAXN];void build(int idx,int l,int r){ seg[idx].l = l; seg[idx].r = r; seg[idx].cnt = 0; if ( l == r ) return; int mid = ( l + r ) >> 1; build(idx > 1; ... 阅读全文