| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 148403 | 본인 하지만 안 어림 ㅋㅋ (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "unique.h"
using namespace std;
int leftCount[202]; // [ 0, i ]
int rightCount[202]; // [ i, N - 1 ]
vector<int> PickUnique(int N) {
if(N == 1) return vector<int>(1, 1);
vector<int> ans(N, 0);
int total = UniqueCount(0, N - 1);
leftCount[N - 1] = total;
rightCount[0] = total;
leftCount[0] = 1;
rightCount[N - 1] = 1;
for(int i = 1; i < N - 1; i++){
leftCount[i] = UniqueCount(0, i);
rightCount[i] = UniqueCount(i, N - 1);
}
for(int i = 0; i < N; i++){
// 1. i번 뒤에 같은 수가 없어야 함.
bool notInRight = i == N - 1 || rightCount[i + 1] < rightCount[i];
bool notInLeft = i == 0 || leftCount[i - 1] < leftCount[i];
ans[i] = notInRight && notInLeft;
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
