This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int mxn=300+5;
int dif[mxn][mxn],n,q,a[mxn],l;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>l;
for(int i=1;i<=n;i++)
cin>>a[i];
for(int i=1;i<=n-l+1;i++){
for(int j=1;j<=n-l+1;j++){
for(int k=0;k<l;k++){
if(a[i+k]!=a[j+k])dif[i][j]++;
}
}
}
cin>>q;
for(int i=1;i<=q;i++){
int x;
cin>>x;
for(int j=1;j<=n-l+1;j++){
int res=0;
for(int k=1;k<=n-l+1;k++)
res+=(dif[j][k]>x || j==k)?0:1;
cout<<res<<" ";
}
cout<<'\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |