中山 网站建设一条龙服务,做网站花了三万块,成都做网站的,百度推广一年收费标准题目#xff1a;http://poj.org/problem?id2777 别忘了各地的return#xff1b; 有可能输入的LR#xff0c;手动swap#xff1b; 似乎是多组输入#xff1f; pushup和pushdown的位置。 #xff08;原来pushup只有一行#xff09; 要开四倍数组。是这种写法的原因吧…题目http://poj.org/problem?id2777 别忘了各地的return 有可能输入的LR手动swap 似乎是多组输入 pushup和pushdown的位置。 原来pushup只有一行 要开四倍数组。是这种写法的原因吧。 #includeiostream
#includecstdio
#includecstring
using namespace std;
const int N400005;
int n,m,q,L,R,co;
char ch;
long long col[N],lazy[N];
void pushdown(int cnt)
{if(lazy[cnt]){col[cnt*2]lazy[cnt];col[cnt*21]lazy[cnt];lazy[cnt*2]lazy[cnt];lazy[cnt*21]lazy[cnt];lazy[cnt]0;}
}
void pushup(int cnt)
{col[cnt](col[cnt*2]|col[cnt*21]);
}
void add(int l,int r,int cnt)
{if(lLrR){col[cnt]co;lazy[cnt]co;return;}pushdown(cnt);int mid(lr)/2;if(midL)add(l,mid,cnt*2);if(midR)add(mid1,r,cnt*21);pushup(cnt);
}
long long query(int l,int r,int cnt)
{if(lLrR){return col[cnt];}long long ans0;pushdown(cnt);int mid(lr)/2;if(midL)ans|query(l,mid,cnt*2);if(midR)ans|query(mid1,r,cnt*21);return ans;
}
void build(int l,int r,int cnt)
{col[cnt]1;if(lr)return;int mid(lr)/2;build(l,mid,cnt*2);build(mid1,r,cnt*21);
}
int main()
{while(scanf(%d%d%d,n,m,q)!EOF){build(1,n,1);memset(lazy,0,sizeof lazy);for(int i1;iq;i){scanf( %c%d%d,ch,L,R);if(LR)swap(L,R);//if(chC){scanf(%d,co);co(1(co-1));add(1,n,1);}if(chP){int ret0;long long ansquery(1,n,1);while(ans){ret(ans1);ans1;}printf(%d\n,ret);}}}return 0;
} 转载于:https://www.cnblogs.com/Narh/p/8721372.html