QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#832485#8701. BorderDerrickLo0 0ms3552kbC++14839b2024-12-25 21:57:562024-12-25 21:58:02

Judging History

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

  • [2024-12-25 21:58:02]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:3552kb
  • [2024-12-25 21:57:56]
  • 提交

answer

#include<bits/stdc++.h>
#define mod 998244353
using namespace std;
int n,f[2][183][797][2],ans,t=510;
string s;
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>s,s=" "+s;
	for(int i=1;i<n+1-i;i++)swap(s[i],s[n+1-i]);
	f[0][0][t][0]=1;
	for(int i=1;i<=n;i++){
		int now=(i&1);
		for(int j=0;j<=i/3+1;j++)for(int k=t-i;k<=t+j;k++)f[now][j][k][0]=f[now][j][k][1]=0;
		if(s[i]!='0'){
			for(int j=0;j<=(i-1)/3+1;j++)for(int k=t-(i-1);k<=t+j;k++)if(k+3-t<=j+1)f[now][max(j,k+3-t)][k+3][1]=(f[now][max(j,k+3-t)][k+3][1]+f[now^1][j][k][0])%mod;
		}
		if(s[i]!='1'){
			for(int j=0;j<=(i-1)/3+1;j++)for(int k=t-(i-1);k<=t+j;k++)f[now][j][k-1][0]=(f[now][j][k-1][0]+(f[now^1][j][k][1]+f[now^1][j][k][0])%mod)%mod;
		}
	}
	for(int i=0;i<=n/3+1;i++)ans=(ans+f[n&1][i][t][0])%mod;
	cout<<ans;
	return 0;
} 

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3552kb

input:

cbaababaabacbaababaabacbaabacbaababaabacbaaba
dabbababbabaabbafabbgbaabfebaabzababbayaabcac

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%