QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#393759#7303. City UnitedD_F_SWA 3ms7772kbC++14533b2024-04-19 11:06:042024-04-19 11:06:04

Judging History

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

  • [2024-04-19 11:06:04]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:7772kb
  • [2024-04-19 11:06:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,i,j,x,y,c[4],p[13]={1},e[51][13],f[51][531441];
int main()
{
	for(i=1;i<13;++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;
	f[0][0]=1; for(i=1;i<=n;++i)
	{
		for(x=0;x<p[12];++x) if(m=f[i-1][x]%4)
		{
			for(c[1]=c[2]=j=0;j<12;++j) c[3-(x/p[j])%3]|=e[i][j];
			f[i][y=x*3%(p[12]-1)]+=m; for(j=1;j<3;++j) f[i][y+j]+=(1-c[j])*m;
		}
	}
	for(m=0,x=1;x<p[12];++x) m+=f[n][x]; printf("%d\n",m%4/2); return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3952kb

input:

3 2
1 2
2 3

output:

0

result:

ok 1 number(s): "0"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

3 3
1 2
2 3
3 1

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: -100
Wrong Answer
time: 3ms
memory: 7772kb

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'