Submission #148512

#TimeUsernameProblemLanguageResultExecution timeMemory
148512Powered By Zigui (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms512 KiB
#include "unique.h" int l[202], r[202]; std::vector<int> ans; std::vector<int> PickUnique(int N) { int x = UniqueCount(0, N-1); for(int i=0;i<N;i++) { if(i == 0) l[1] = 1; else l[i+1] = UniqueCount(0, i); if(i == 0) r[N] = 1; else r[N-i] = UniqueCount(N-i-1, N-1); } ans.resize(N); for(int i=0;i<N;i++) { ans[i] = (l[i] < l[i+1] && r[i+1] > r[i+2]); } return ans; }

Compilation message (stderr)

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:7:9: warning: unused variable 'x' [-Wunused-variable]
     int x = UniqueCount(0, N-1);
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...