Submission #151486

#TimeUsernameProblemLanguageResultExecution timeMemory
151486leduykhongnguList of Unique Integers (FXCUP4_unique)C++17
100 / 100
2 ms504 KiB
#include "unique.h" #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; }
#Verdict Execution timeMemoryGrader output
Fetching results...