| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 151004 | JustInCase | List of Unique Integers (FXCUP4_unique) | C++17 | 2 ms | 508 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#ifdef LOCAL
#include "grader.cpp"
#else
#include "unique.h"
#endif
#define pick_unique PickUnique
#define unique_count UniqueCount
#define int32_t int
#define int64_t long long
std::vector< int32_t > pick_unique(int32_t n) {
std::vector< int32_t > cntFront(n), cntBack(n), res(n, 0);
for(int32_t i = 0; i < n; i++) {
cntFront[i] = unique_count(0, i);
cntBack[i] = unique_count(i, n - 1);
}
for(int32_t i = 0; i < n; i++) {
if(i == 0) {
if(cntBack[i] > cntBack[i + 1]) {
res[i] = 1;
}
}
else if(i == n - 1) {
if(cntFront[i] > cntFront[i - 1]) {
res[i] = 1;
}
}
else {
if(cntFront[i] > cntFront[i - 1] && cntBack[i] > cntBack[i + 1]) {
res[i] = 1;
}
}
}
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
