# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148372 | 본인 하지만 안 어림 ㅋㅋ (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 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.
#include "unique.h"
using namespace std;
vector<int> PickUnique(int N) {
if(N == 1) return vector<int>(1, 1);
vector<int> ans(N, 0);
int total = UniqueCount(0, N - 1);
for(int i = 0; i < N; i++){
if(i == 0){
int right = UniqueCount(1, N - 1);
if(total > right) ans[0] = 1;
}
else if(i == N - 1){
int left = UniqueCount(0, N - 2);
if(total > left) ans[N - 1] = 1;
}
else{
int leftExcept = UniqueCount(0, i - 1);
int leftContain = UniqueCount(0, i);
bool notInLeft = leftContain > leftExcept;
int rightExcept = UniqueCount(i + 1, N - 1);
int rightContain = UniqueCount(i, N - 1);
bool notInRight = rightContain > rightExcept;
if(notInLeft && notInRight) ans[i] = 1;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |