Submission #1101727

#TimeUsernameProblemLanguageResultExecution timeMemory
1101727rayan_bdList of Unique Integers (FXCUP4_unique)C++17
100 / 100
1 ms596 KiB
#include "unique.h" using namespace std; std::vector<int> PickUnique(int N){ vector<int> ans(N,0),pref(N+5,0),suff(N+5,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-1]<pref[i]&&suff[i]>suff[i+1]){ ans[i-1]=1; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...