QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#393781#7303. City UnitedD_F_SWA 6ms13992kbC++14460b2024-04-19 11:52:212024-04-19 11:52:22

Judging History

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

  • [2024-04-19 11:52:22]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:13992kb
  • [2024-04-19 11:52:21]
  • 提交

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'