# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
448549 | Edbert2397 | Martian DNA (BOI18_dna) | C++14 | 72 ms | 4476 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.
/*
~2021~
*/
# include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
#define pii pair<int,int>
#define debug(x) cout << #x << '=' << x << endl;
const int N = 2e5 + 5;
const int INF = 1e9;
const ll mod = 1e9+7;
int need[N],arr[N],n,k,q,byk[N];
bool valid(int x){
for(int i = 0;i<k;i++) byk[i] = 0;
int cnt = 0;
for(int i = 1;i<=n;i++){
if(i > x){
if(byk[arr[i-x]] == need[arr[i-x]]) cnt--;
byk[arr[i-x]]--;
}
byk[arr[i]]++;
if(byk[arr[i]] == need[arr[i]]) cnt++;
if(cnt == q) 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... |