1 solutions

  • 0
    @ 2023-9-14 16:52:03

    显然可以线段树,均摊的板子题。

    void change(int u,int l,int r){
    	if(tr[u].maxx<=2)return;
    	if(tr[u].l==tr[u].r){
    		if(!(tr[u].l>=l&&tr[u].r<=r))return;
    		tr[u].sum=log2(tr[u].sum)+1;
    		tr[u].maxx=tr[u].sum;
    		return;
    	}
    	int mid=tr[u].l+tr[u].r>>1;
    	if(l<=mid)change(u<<1,l,r);
    	if(r>mid)change(u<<1|1,l,r);
    	pushup(u);
    }
    
    • 1

    Information

    ID
    5916
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    4
    Tags
    # Submissions
    10
    Accepted
    2
    Uploaded By