QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#127314#5191. 混乱邪恶tytytyRE 0ms0kbC++141.4kb2023-07-19 15:40:522023-07-19 15:40:55

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-19 15:40:55]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-07-19 15:40:52]
  • 提交

answer

#include<bits/stdc++.h>
#define cout cerr
#define C(x,y) (x-y+p)%p 
#define debug cout<<"debug"<<endl;
using namespace std;
const int N=105;
const int M=20;
int n,p,L,G,t;
struct node {
	int a[13];
}idea[N];
bitset<N> f[2][M][M][N];
int read() {
	int x=0,f=0; char ch=getchar();
	while(!isdigit(ch)) {if(ch=='-') f=1; ch=getchar();}
	while(isdigit(ch)) {x=(x<<1)+(x<<3)+(ch^48); ch=getchar();}
	return f?-x:x;
}
int main()
{
	srand(time(0));
	n=read(),p=read();
	t=2*sqrt(n);
	for(int i=1;i<=n;i++) {
		for(int j=1;j<=12;j++) idea[i].a[j]=read();
	}
	L=read()%p,G=read()%p;
	random_shuffle(idea+1,idea+n+1);
	f[0][0][0][t].set(t);
	for(int i=1;i<=n;i++) {
		for(int l=0;l<p;l++) {
			for(int g=0;g<p;g++) {
				for(int x=0;x<=2*t;x++) {
					f[i&1][l][g][x].reset();
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[1])][C(g,idea[i].a[2])][x]<<1;
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[3])][C(g,idea[i].a[4])][x+1];
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[5])][C(g,idea[i].a[6])][x+1]>>1;
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[7])][C(g,idea[i].a[8])][x]>>1;
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[9])][C(g,idea[i].a[10])][x-1];
					f[i&1][l][g][x]|=f[(i&1)^1][C(l,idea[i].a[11])][C(g,idea[i].a[12])][x-1]<<1;
				}
			}
		}
	}
	if(f[n&1][L][G][t][t]) printf("Chaotic Evil");
	else printf("Not a true problem setter");
	return 0;
}

详细

Test #1:

score: 0
Runtime Error

input:

100 97
44 3 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
16 45 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
16 45 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0 0 0 0 0 0
16 45 0 0 0 0 0 0 0 0 0 0
16 45 0 0 0 0 0 0 0 0 0 0
44 3 0 0 0 0 0...

output:


result: