# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299306 | dolphingarlic | Martian DNA (BOI18_dna) | C++14 | 68 ms | 4728 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>
#pragma GCC optimize("O3")
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
int n, k, r;
int a[200001], req[200001], cnt[200001];
bool check(int len) {
int num_fulfilled = 0;
fill(cnt, cnt + n, 0);
FOR(i, 0, len) {
cnt[a[i]]++;
if (cnt[a[i]] == req[a[i]]) num_fulfilled++;
}
if (num_fulfilled == r) return true;
FOR(i, len, n) {
if (cnt[a[i - len]] == req[a[i - len]]) num_fulfilled--;
cnt[a[i - len]]--;
cnt[a[i]]++;
if (cnt[a[i]] == req[a[i]]) num_fulfilled++;
if (num_fulfilled == r) return true;
}
return false;
}
# | 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... |