In which testcases am i getting WA?
link text
here’s my solution:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
long t;
cin>>t;
while(t--)
{
long a[10001],b[10001],m,n,flag=0,i,j;
cin>>m;
for(i=1;i<=m;++i) cin>>a[i];
cin>>n;
for(i=1;i<=n;++i) cin>>b[i];
for(i=1;i<=m;++i)
{
int count=0,k=1;
if(a[i]==b[k])
{
k=i;++count;
for(j=2;j<=n;++j)
{
if(a[++k]==b[j]) ++count;
else break;
}
if(count>=n) {cout<<"Yes\n";flag=1;break;}
}
}
if(flag==0) cout<<"No\n";
}
return 0;
}