| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 246341 | Sorting | Lottery (CEOI18_lot) | C++14 | 755 ms | 65536 KiB |
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 k_N = 1e4 + 3;
int n, l;
int a[k_N];
int cnt[k_N][k_N];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> l;
for(int i = 0; i < n; ++i)
cin >> a[i];
for(int i = 0; i < n - l + 1; ++i){
for(int j = i + 1; j < n - l + 1; ++j){
int diff = 0;
for(int k = 0; k < l; ++k)
if(a[i + k] != a[j + k])
diff++;
cnt[i][diff]++;
cnt[j][diff]++;
}
}
for(int i = 0; i < n; ++i)
for(int j = 1; j < n; ++j)
cnt[i][j] += cnt[i][j - 1];
int q;
cin >> q;
for(int i = 0; i < q; ++i){
int k;
cin >> k;
for(int j = 0; j < n - l + 1; ++j)
cout << cnt[j][k] << " ";
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... | ||||
