# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
458057 | JovanB | Martian DNA (BOI18_dna) | C++17 | 71 ms | 4456 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;
typedef long long ll;
typedef long double ld;
int n, k, R;
int niz[200005];
int treba[200005];
int br[200005];
bool check(int x){
for(int i=1; i<=k; i++){
br[i] = 0;
}
int cnt = 0;
for(int i=1; i<=x; i++){
br[niz[i]]++;
if(br[niz[i]] == treba[niz[i]]) cnt++;
}
if(cnt >= R) return 1;
for(int i=x+1; i<=n; i++){
br[niz[i]]++;
if(br[niz[i]] == treba[niz[i]]) cnt++;
br[niz[i-x]]--;
if(br[niz[i-x]] == treba[niz[i-x]]-1) cnt--;
if(cnt >= R) return 1;
}
return 0;
# | 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... |