QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#766021#9489. 0100 Insertionzero-rangeWA 27ms58388kbC++23516b2024-11-20 15:57:362024-11-20 15:57:36

Judging History

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

  • [2024-11-20 15:57:36]
  • 评测
  • 测评结果:WA
  • 用时:27ms
  • 内存:58388kb
  • [2024-11-20 15:57:36]
  • 提交

answer

#include<stdio.h>
#define M 505
int f[505][125][255],n;
char s[M];
constexpr int mod=998244353;
int main(){
	scanf("%d%s",&n,s);
	f[0][0][0]=1;
	for(int i=0;i<n;++i) if(s[i]!='1'){
		for(int j=0;j<=n/4;++j) for(int k=0;k<=n/2;++k) if(f[i][j][k]){
			if(k) (f[i+1][j][k-1]+=f[i][j][k])%=mod;
			else (f[i+1][j+1][k]+=f[i][j][k])%=mod;
			if(i+1<n&&s[i+1]!='0'){
				if(k==1&&j) (f[i+2][j-1][k+1]+=f[i][j][k])%=mod;
				else (f[i+2][j][k+2]+=f[i][j][k])%=mod;
			}
		}
	}
	printf("%d",f[n][0][0]);
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 1636kb

input:

8
0??0?100

output:

2

result:

ok "2"

Test #2:

score: 0
Accepted
time: 0ms
memory: 1668kb

input:

4
?10?

output:

1

result:

ok "1"

Test #3:

score: 0
Accepted
time: 0ms
memory: 1760kb

input:

28
???????????0???0??????1???0?

output:

2023

result:

ok "2023"

Test #4:

score: 0
Accepted
time: 0ms
memory: 1492kb

input:

4
????

output:

1

result:

ok "1"

Test #5:

score: 0
Accepted
time: 0ms
memory: 1612kb

input:

8
11111111

output:

0

result:

ok "0"

Test #6:

score: -100
Wrong Answer
time: 27ms
memory: 58388kb

input:

500
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????...

output:

391856657

result:

wrong answer 1st words differ - expected: '870731023', found: '391856657'