Submission #148483

#TimeUsernameProblemLanguageResultExecution timeMemory
148483욱방켜!! (twitch.tv/wookje) (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
9 ms512 KiB
#include "unique.h" int L[200], R[200]; std::vector<int> PickUnique(int N) { std::vector<int> ret(N,1); L[0]=R[N-1]=1; for(int i=1;i<N;i++) L[i]=UniqueCount(0,i); for(int i=N-2;i>=0;i--) R[i]=UniqueCount(i,N-1); for(int i=1;i<N;i++) if(L[i-1]>=L[i]) ret[i]=0; for(int i=N-2;i>=0;i--) if(R[i]<=R[i+1]) ret[i]=0; return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...