# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148701 | mit한의대지망생 (#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) {
vector<int> ans(N, 1), ucp(N), ucs(N);
ucp[0] = 1;
for(int i = 1; i < N; i++){
ucp[i] = UniqueCount(0, i);
}
ucs[N-1] = 1;
for(int i = 0; i < N-1; i++){
ucs[i] = UniqueCount(i, N-1);
}
ans[0] = (ucs[0] == ucs[1] + 1);
ans[N-1] = (ucp[N-1] == ucp[N-2] + 1);
for(int i = 1; i < N-1; i++){
ans[i] = (ucs[i] == ucs[i+1] + 1) && (ucp[i] == ucp[i-1] + 1);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |