Submission #917962

#TimeUsernameProblemLanguageResultExecution timeMemory
917962PM1Lottery (CEOI18_lot)C++17
25 / 100
5 ms756 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...