Submission #483351

#TimeUsernameProblemLanguageResultExecution timeMemory
483351BERNARB01Lottery (CEOI18_lot)C++17
25 / 100
3075 ms448 KiB
#include <bits/stdc++.h> using namespace std; const int N = 10004; int n, l, a[N], q, v[N]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n >> l; for (int i = 0; i < n; i++) { cin >> a[i]; } cin >> q; while (q--) { int k; cin >> k; fill(v, v + n - l + 1, 0); for (int i = 0; i + l <= n; i++) { for (int j = i + 1; j + l <= n; j++) { if (j == i) continue; int c = 0; for (int kk = 0; kk < l; kk++) { c += (a[i + kk] != a[j + kk]); } v[i] += (c <= k); v[j] += (c <= k); } } for (int i = 0; i + l <= n; i++) { if (i > 0) { cout << " "; } cout << v[i]; } cout << '\n'; } return 0; }
#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...