QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#393763 | #7303. City United | D_F_S | WA | 11ms | 7924kb | C++14 | 498b | 2024-04-19 11:10:50 | 2024-04-19 11:10:50 |
Judging History
answer
#include<cstdio>
int n,m,i,j,x,y,c[4],p[14]={1},e[51][14],f[51][1594323];
int main()
{
for(i=1;i<14;++i) p[i]=p[i-1]*3; for(scanf("%d%d",&n,&m);m--;)
scanf("%d%d",&x,&y), x>y&&(x^=y^=x^=y), e[y][y-x-1]=1;
for(i=f[0][0]=1;i<=n;++i)
{
for(x=0;x<p[13];++x) if(m=f[i-1][x]%4)
{
for(c[1]=c[2]=j=0;j<13;++j) c[3-(x/p[j])%3]|=e[i][j];
f[i][y=x*3%p[13]]+=m; for(j=1;j<3;++j) f[i][y+j]+=(1-c[j])*m;
}
}
for(m=0,x=1;x<p[13];++x) m+=f[n][x]; printf("%d\n",m%4/2); return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 1632kb
input:
3 2 1 2 2 3
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 2ms
memory: 1616kb
input:
3 3 1 2 2 3 3 1
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: -100
Wrong Answer
time: 11ms
memory: 7924kb
input:
15 31 9 5 14 5 2 7 5 15 11 14 11 9 2 6 3 4 12 1 6 8 3 5 11 10 15 6 4 1 1 2 8 9 6 12 14 10 13 2 4 5 3 8 3 15 11 6 7 5 4 6 11 2 13 15 3 2 8 4 6 13 7 10
output:
0
result:
wrong answer 1st numbers differ - expected: '1', found: '0'