QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#743967#9568. Left Shifting 3whileone27WA 0ms3488kbC++14497b2024-11-13 20:27:192024-11-13 20:27:25

Judging History

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

  • [2024-11-13 20:27:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3488kb
  • [2024-11-13 20:27:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int T,n,x,k;
int bb[N];string s,ss,t;
int ppp(int x){
	for(int i=1;i<=7;++i)
	if(t[i]!=s[x+i-1])return 0;
	return 1;
}
signed main(){
	cin>>T;
	t=" nanjing";
	while(T--){
		cin>>n>>k>>ss;
		k=min(n,k);
		ss=" "+ss;
		s=ss;
		for(int i=1;i<=k;++i)s=s+ss[i];
		int ans=0;
		for(int i=1;i<=n+k-6;++i)bb[i]=ppp(i),bb[i]+=bb[i-1];
		for(int i=7;i<=n+k;++i)
			ans=max(ans,bb[i-6]-bb[i-n]);
		cout<<ans<<'\n';
	}
}

详细

Test #1:

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

input:

4
21 10
jingicpcnanjingsuanan
21 0
jingicpcnanjingsuanan
21 3
nanjingnanjingnanjing
4 100
icpc

output:

704617792
704617792
704617697
0

result:

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