QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#246475#4669. Genetic ModificationsEznibuilWA 0ms1520kbC++14600b2023-11-10 20:53:202023-11-10 20:53:21

Judging History

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

  • [2023-11-10 20:53:21]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:1520kb
  • [2023-11-10 20:53:20]
  • 提交

answer

#include<cstdio>
#include<cstring>
char s[100003],t[100003];
int l[100003],r[100003];
int main()
{
	scanf("%s%s",s+1,t+1),l[0]=r[0]=0;
	int lt=strlen(t+1)+1;
	for(int i=1;i<lt;i++)
	{
		if(s[l[i-1]+1]==t[i])
			l[i]=l[i-1]+1;
		else
			for(l[i]=l[i-1]+1;s[l[i-1]+1]==s[l[i]];l[i]++);
		if(s[r[i-1]+1]==t[i])
			for(r[i]=r[i-1]+1;s[r[i-1]+1]==s[r[i]+1];r[i]++);
		else
			for(r[i]=r[i-1]+1;s[r[i-1]+1]==s[r[i]];r[i]++);
	}
	if(!s[l[lt-1]])
		return printf("NO"),0;
	for(int i=r[lt-1]+1;s[i];i++)
		if(s[i]!=s[r[lt-1]+1])
			return printf("NO"),0;
	printf("YES");
	return 0;
}

詳細信息

Test #1:

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

input:

BBAAABBAAABAAA
BAAB

output:

YES

result:

wrong output format Unexpected end of file - int32 expected