// 誤解法(64並列なし、vector使用)チェック #pragma GCC optimize("unroll-loops") vectorT(64,true);vectorF(64,false); struct U{vectora,b;bool c;U(vectorA=T,vectorB=F,bool C=false):a(A),b(B),c(C){};}; vectorO(const U&b,const vector&a){vectorc(64);rep(d,64){c[d]=(b.c?!a[d]:a[d])&b.a[d]|b.b[d];}return c;} void C(const U&f,U&b){if(f.c){b.a.flip();b.b.flip();b.c=!b.c;swap(b.a,b.b);rep(d,64)b.b[d]=b.b[d]&&b.a[d]&&f.a[d]||f.b[d],b.a[d]=b.a[d]&&f.a[d];}else{rep(d,64)b.a[d]=b.a[d]&&f.a[d],b.b[d]=b.b[d]&&f.a[d]||f.b[d];}} { ull@N,@Q,M=1000,h,l,r,x,y,m,n,u; vectorP[6],A[N],a; U B[M]={},f; rep(i,6)rep(d,64)P[i].push_back((d>>i)&1); rep(i,N)A[i]=P[i%6]; string E="land",o; rep(Q){ rd(h,o,l,r,x,y); r++;y++; a=O(B[h/M],A[h]); f=o==E?U(a):U(T,a,o>X; o="No"; rep(i,x,y){ a=O(B[i/M],A[i]); if(X.count(a)){o="Yes";break;} X.insert(a); } wt(o); } }