标签:amp span def namespace turn efi void c++ bit
#include<bits/stdc++.h> using namespace std; #define N 4000010 int mn[N],s[N],va[N],bz[N],n,m,mt[N]; #define id(x,y) mt[(x-1)*m+y] void bd(int o,int l,int r){ if(l==r){ mn[o]=va[l]; s[o]=1;return; } int md=(l+r)/2; bd(o*2,l,md); bd(o*2+1,md+1,r); mn[o]=min(mn[o*2],mn[o*2+1]); s[o]=0; if(mn[o]==mn[o*2])s[o]+=s[o*2]; if(mn[o]==mn[o*2+1])s[o]+=s[o*2+1]; } void pd(int o){ bz[o*2]+=bz[o]; bz[o*2+1]+=bz[o]; mn[o*2]+=bz[o]; mn[o*2+1]+=bz[o]; bz[o]=0; } void mod(int o,int l,int r,int x,int y,int v){ if(x>y||r<x||y<l)return; if(x<=l&&r<=y){ mn[o]+=v; bz[o]+=v; return; } int md=(l+r)/2; mod(o*2,l,md,x,y,v); mod(o*2+1,md+1,r,x,y,v); mn[o]=min(mn[o*2],mn[o*2+1]); s[o]=0; if(mn[o]==mn[o*2])s[o]+=s[o*2]; if(mn[o]==mn[o*2+1])s[o]+=s[o*2+1]; } struct no{ int x,y; }a[N]; int tx[4]={1,0,-1,0},ty[4]={0,-1,0,1}; int in(int x,int y){return x>0&&x<=n&&y>0&&y<=m;} int m1(int x){ int mn=l+1; if(in(tx[0]+a[x].x,ty[0]+a[x].y)) mn=min(mn,id(tx[0]+a[x].x,ty[0]+a[x].y)); if(in(tx[1]+a[x].x,ty[1]+a[x].y)) mn=min(mn,id(tx[1]+a[x].x,ty[1]+a[x].y)); return mn; } int m2(int x){ int r1=l+1,r2=l+1; for(int i=0;i<4;i++) if(in(tx[i]+a[x].x,ty[i]+a[x].y)){ if(id(tx[i]+a[x].x,ty[i]+a[x].y)<r1) } } int main(){ }
标签:amp span def namespace turn efi void c++ bit
原文地址:https://www.cnblogs.com/rilisoft/p/11584735.html