Divide by Zero 2018 and Codeforces Round #474 (Div. 1 + Div. 2, combined) F. Pathwalks(动态开点线段树)
题目n(nusingnamespacestd;constintN=1e5+10;intn,m,root[N],cnt;intans,u,v,w,num;//主席树动态开点思想structnode{intl,r,mx;node():l(0),r(0),mx(0){}}e[N*20];voidupd(int&p,intl,intr,intx,intv){if(!p)p=++cnt;if(l==r){e