# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
804573 | Valaki2 | Lottery (CEOI18_lot) | C++14 | 18 ms | 15960 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;
#define ll long long
#define pb push_back
const int maxn = 2000; //!!!!!
int n, l, q;
int v[1 + maxn];
short dp[1 + maxn][1 + maxn];
short ans[1 + maxn][1 + maxn];
void solve() {
cin >> n >> l;
for(int i = 1; i <= n; i++) {
cin >> v[i];
}
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
dp[i][j] = dp[i - 1][j - 1];
if(v[i] != v[j]) {
dp[i][j]++;
}
}
}
for(int i = l; i <= n; i++) {
for(int j = l; j <= n; j++) {
short dist = dp[i][j] - dp[i - l][j - l];
ans[i - l + 1][dist]++;
# | 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... |