摘要:
思路:二分查找位置,之后是裸的树状数组。#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 100010#define Maxm 200010#define LL int#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x=val[i]-d) l--; if(sorted[r]>val[i]+d||r... 阅读全文
摘要:
思路:树链剖分入门题,我这门入得好苦啊,程序很快写出来了,可是在LCA过程中把update函数里的左右边界位置写反了,一直RE到死。#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 50010#define Maxm 200010#def 阅读全文