QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#668020#9518. 观虫我 (旧版数据)zhouhuanyiCompile Error//C++141.3kb2024-10-23 10:42:112024-10-23 10:42:21

Judging History

你现在查看的是最新测评结果

  • [2024-10-23 10:42:21]
  • 评测
  • [2024-10-23 10:42:11]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<random>
#include<bitset>
#define N 134217728
#define M 32
using namespace std;
mt19937 RAND(random_device{}());
unsigned int read()
{
	char c=0;
	unsigned int sum=0;
	while (c<'0'||c>'9') c=getchar();
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum;
}
int n,q,p[M+1];
unsigned long long res,rst,delta[N+1],sdelta[64][64];
int main()
{
	char op;
	int s1,s2,s3,s4;
	unsigned int x,d,st=0,st2=0,st3=0;
	n=read(),q=read();
	for (int i=0;i<n;++i) p[i]=i;
	shuffle(p,p+n,RAND);
	for (int i=0;i<n;++i)
	{
		op=p[i]%3;
		if (!op) st|=(1u<<i);
		else if (op==1) st2|=(1u<<i);
		else st3|=(1u<<i);
	}
	for (int i=0;i<=63;++i)
		for (int j=0;j<=63;++j)
			for (int k=0;k<=63;++k)
				if ((j&k)==k)
					sdelta[i][j]|=(1ull<<(i^k));
	for (int i=1;i<=q;++i)
	{
		cin>>op,x=read();
		if (op=='!')
		{
			d=(st^(x&st))|(x&st3),s1=x>>6,s2=x&63,s3=d>>6,s4=d&63,res=sdelta[s2][s4];
			for (int j=s3;j>0;j=(j-1)&s3) delta[s1^j]^=res;
			delta[s1]^=res;
		}
		else
		{
			d=(x&st2)|(st3^(x&st3)),x^=(x&st3),s1=x>>6,s2=x&63,s3=d>>6,s4=d&63,res=0;
			for (int j=s3;j>0;j=(j-1)&s3) res^=delta[s1^j];
			res^=delta[s1],printf("%d\n",__builtin_parityll(res&sdelta[s2][s4]));
		}
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:27:9: error: ‘shuffle’ was not declared in this scope
   27 |         shuffle(p,p+n,RAND);
      |         ^~~~~~~