# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
396737 | danielcm585 | Martian DNA (BOI18_dna) | C++14 | 63 ms | 2460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int> ii;
const int N = 2e5;
int n, k, r;
int a[N+2], cnt[N+2], need[N+2];
bool can(int mid) {
memset(cnt,0,sizeof(cnt));
int get = 0;
for (int i = 1; i <= n; i++) {
cnt[a[i]]++;
get += (need[a[i]] && cnt[a[i]] == need[a[i]]);
if (i-mid >= 1) {
get -= (need[a[i-mid]] && cnt[a[i-mid]] == need[a[i-mid]]);
cnt[a[i-mid]]--;
}
if (i >= mid && get == r) return 1;
}
return 0;
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(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... |