Submission #227617

#TimeUsernameProblemLanguageResultExecution timeMemory
227617bensonlzlList of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms616 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; vector<int> PickUnique(int N) { int pref[205], suff[205]; vector<int> u; u.resize(N,0); pref[0] = suff[N+1] = 0; for (int i = 1; i <= N; ++i){ pref[i] = UniqueCount(0, i-1); suff[i] = UniqueCount(i-1, N-1); } for (int i = 1; i <= N; ++i){ if (pref[i] > pref[i-1] && suff[i] > suff[i+1]) u[i-1] = 1; } return u; }
#Verdict Execution timeMemoryGrader output
Fetching results...