# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
671746 | LittleCube | Lottery (CEOI18_lot) | C++14 | 594 ms | 8376 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>
#define ll long long
#define plll tuple<ll, ll, ll>
using namespace std;
int n, l, q, a[10005], ans[10005][105], pos[10005], b[105], qu[105];
signed main()
{
cin >> n >> l;
for (int i = 1; i <= n; i++)
cin >> a[i];
cin >> q;
for (int i = 1; i <= q; i++)
{
cin >> b[i];
qu[i] = b[i];
}
sort(qu + 1, qu + 1 + q);
for (int i = q; i >= 1; i--)
for (int j = qu[i - 1]; j <= qu[i]; j++)
pos[j] = i;
for (int d = 1; d <= n - l; d++)
{
int cur = 0;
for (int i = 0; i < l; i++)
cur += a[i] != a[i + d];
for (int i = 1; i + l - 1 + d <= n; i++)
{
cur -= a[i - 1] != a[i - 1 + d];
cur += a[i + l - 1] != a[i + l - 1 + d];
# | 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... |