Submission #109004

#TimeUsernameProblemLanguageResultExecution timeMemory
109004Leonardo_PaesLottery (CEOI18_lot)C++11
25 / 100
88 ms512 KiB
#include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 10; int vet[maxn]; int main(){ int n, l; cin >> n >> l; for(int i=1; i<=n; i++){ cin >> vet[i]; } int q; cin >> q; for(int i=1; i<=q; i++){ int k; cin >> k; for(int ini=1; ini<=n-l+1; ini++){ int ans=0; for(int fim=1; fim<=n-l+1; fim++){ if(fim==ini)fim++; if(fim>n-l+1)break; int sum=0; for(int w=0; w<l; w++){ if(vet[ini+w]!=vet[fim+w])sum++; } if(sum<=k)ans++; } cout << ans << " "; } cout << endl; } }
#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...