QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#393781 | #7303. City United | D_F_S | WA | 6ms | 13992kb | C++14 | 460b | 2024-04-19 11:52:21 | 2024-04-19 11:52:22 |
Judging History
answer
#include<cstdio>
const int U=1594323;int n,m,i,j,x,y,c[4],p[14]={1},e[51],a[U],b[U],f[51][U];int main(){for(i=1;i<14;++i) p[i]=p[i-1]*3;for(x=0;x<U;++x) a[x]=a[x/3]*2+(x%3/2),b[x]=b[x/3]*2+(x%3==1);for(scanf("%d%d",&n,&m);m--;)scanf("%d%d",&x,&y),x>y&&(x^=y^=x^=y),e[y]|=1<<y-x-1;for(i=f[0][0]=1;i<=n;++i)for(x=0;x<U;++x)if(m=f[i-1][x]%4)f[i][y=x*3%U]+=m,f[i][y+1]+=(e[i]&a[x])*m,f[i][y+2]+=(e[i]&b[x])*m;for(m=-1,x=0;x<U;++x)m+=f[n][x]%4;putchar('1'+m%4/2);}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 6ms
memory: 13992kb
input:
3 2 1 2 2 3
output:
1
result:
wrong answer 1st numbers differ - expected: '0', found: '1'