# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
676782 | Cyanmond | Martian DNA (BOI18_dna) | C++17 | 209 ms | 31344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
int main() {
int N, K, R;
std::cin >> N >> K >> R;
std::vector<int> D(N);
for (auto &e : D) {
std::cin >> e;
}
std::vector<std::vector<int>> index_list(K);
for (int i = 0; i < N; ++i) {
index_list[D[i]].push_back(i);
}
std::vector<std::vector<std::pair<int, bool>>> events(N + 1);
while (R--) {
int B, Q;
std::cin >> B >> Q;
const auto &list = index_list[B];
if ((int)list.size() < Q) {
events[0].push_back({3 * N, true});
break;
}
events[0].push_back({list[Q - 1], true});
for (int i = 0; i < (int)list.size() - Q; ++i) {
events[list[i] + 1].push_back({list[i + Q - 1], false});
events[list[i] + 1].push_back({list[i + Q], true});
}
events[list[(int)list.size() - Q] + 1].push_back({3 * N, true});
# | 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... |