Submission #151241

#TimeUsernameProblemLanguageResultExecution timeMemory
151241dongwon0427List of Unique Integers (FXCUP4_unique)C++17
100 / 100
2 ms504 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; std::vector<int> PickUnique(int n) { vector<int> ret(n); int t = 1; for(int i=1;i<n;i++) { int nxt = UniqueCount(0,i); if(t >= nxt) { ret[i] = 1; } t = nxt; } t = 1; for(int i=n-2;i>=0;i--) { int nxt = UniqueCount(i,n-1); if(t >= nxt) { ret[i] = 1; } t = nxt; } for(int i=0;i<n;i++) ret[i] = 1-ret[i]; return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...