Submission #148959

#TimeUsernameProblemLanguageResultExecution timeMemory
148959etyu (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
7 ms512 KiB
#include "unique.h" int l[209], r[209]; std::vector<int> PickUnique(int N) { for (int i = 0; i < N; i++) { l[i] = UniqueCount(0, i); r[i] = UniqueCount(i, N - 1); } std::vector<int> a; for (int i = 0; i < N; i++) { if ((i == 0 || l[i] - l[i - 1] == 1) && (i == N - 1 || r[i] - r[i + 1] == 1)) a.push_back(1); else a.push_back(0); } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...