# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149710 | usa1+samsung2 (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 7 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"
std::vector<int> PickUnique(int N) {
int c = UniqueCount(0, N - 1);
std::vector<int>L(N);
std::vector<int>R(N);
L[N-1] = R[0] = c;
for (int i = 1; i < N - 1; i++)L[i] = UniqueCount(0, i);
for (int j = N - 2; j >= 0; j--)R[j] = UniqueCount(j, N - 1);
std::vector <int> out(N);
out[0] = R[0] > R[1];
for (int i = 1; i < N-1; i++) {
if (R[i] > R[i + 1] && L[i - 1] < L[i])out[i] = 1;
}
out[N - 1] = L[N - 1] > L[N - 2];
return out;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |