Submission #148694

#TimeUsernameProblemLanguageResultExecution timeMemory
148694(παρα)γεμιστά (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
6 ms384 KiB
#include "unique.h" std::vector<int> PickUnique(int N) { std::vector < int > v(N); for(int i=0;i<N;i++){ v[i]=1; } int last=1000; for(int i=0;i<N;i++){ int t=UniqueCount(i, N-1); if(t>last){ v[i-1]=0; } last=t; // cout<<UniqueCount(i, N-1)<<endl; } // cout<<endl; // for(int i=0;i<N;i++){ // cout<<v[i]<<" "; // } last=1000; for(int i=N-1;i>=0;i--){ int t=UniqueCount(0, i); if(t>last){ v[i+1]=0; } last=t; // cout<<UniqueCount(0, i)<<endl; } // cout<<endl; // for(int i=0;i<N;i++){ // cout<<v[i]<<" "; // } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...