Submission #148573

#TimeUsernameProblemLanguageResultExecution timeMemory
148573JeffreyHo (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms512 KiB
#include "unique.h" #include <vector> std::vector<int> PickUnique(int N) { int a[328] = {}, b[328] = {}; std::vector<int> c(N); for (int i = 0; i < N; i++) a[i] = UniqueCount(0, i); for (int i = 0; i < N; i++) b[i] = UniqueCount(i, N - 1); for (int i = 0; i < N; i++) if ((!i || a[i] == a[i - 1] + 1) && (i == N - 1 || b[i] == b[i + 1] + 1)) c[i] = 1; return c; }
#Verdict Execution timeMemoryGrader output
Fetching results...