QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#604353 | #5191. 混乱邪恶 | DaiRuiChen007 | RE | 0ms | 0kb | C++17 | 986b | 2024-10-02 10:14:44 | 2024-10-02 10:14:44 |
answer
#include<bits/stdc++.h>
#define ui unsigned int
using namespace std;
mt19937 rnd(time(0));
const ui U=(1u<<31)-1;
int n,p,s,t;
ui f[105][105][32],g[105][105][32];
array<int,12> A[105];
signed main() {
scanf("%d%d",&n,&p);
for(int i=1;i<=n;++i) for(int &x:A[i]) scanf("%d",&x);
scanf("%d%d",&s,&t);
for(int k:{0,1,2,3,4}) {
shuffle(A+1,A+n+1,rnd);
memset(f,0,sizeof(f)),f[0][0][15]=1<<15;
for(int o=1;o<=n;++o) {
auto a=A[o];
memset(g,0,sizeof(g));
for(int i=0;i<p;++i) for(int j=0;j<p;++j) for(int x=1;x<31;++x) {
const ui &z=f[i][j][x];
g[(i+a[0])%p][(j+a[1])%p][x]|=(z&U)<<1;
g[(i+a[2])%p][(j+a[3])%p][x-1]|=z;
g[(i+a[4])%p][(j+a[5])%p][x-1]|=z>>1;
g[(i+a[6])%p][(j+a[7])%p][x]|=z>>1;
g[(i+a[8])%p][(j+a[9])%p][x+1]|=z;
g[(i+a[10])%p][(j+a[11])%p][x+1]|=(z&U)<<1;
}
memcpy(f,g,sizeof(f));
}
if(f[s][t][15]>>15&1) return puts("Chaotic Evil");
}
puts("Not a true problem setter");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
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:
Chaotic Evil