poj Buy Tickets (巧妙的线段树)
做完这道题才意识到什么是线段树的巧妙运用。yy才是王道啊!关键词:倒叙插入。#include #define maxn 200050#define lson l , m , rt * 2#define rson m+1 , r , rt * 2 + 1int n;int rest[maxn*4],ans[maxn];int id[maxn],value[maxn]; vo