# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151484 | 2019-09-03T11:36:32 Z | leduykhongngu | List of Unique Integers (FXCUP4_unique) | C++17 | 0 ms | 0 KB |
#include <vector> std::vector<int> PickUnique(int N) { std::vector<int> res(N, 1); int preask = 1; for (int i = 1; i < N; ++i) { int ask = UniqueCount(0, i); if (ask <= preask) { res[i] = 0; } preask = ask; } preask = 1; for (int i = N - 2; i >= 0; --i) { int ask = UniqueCount(i, N - 1); if (ask <= preask) { res[i] = 0; } preask = ask; } return res; }