Submission #148856

#TimeUsernameProblemLanguageResultExecution timeMemory
148856Solo Leveling (#200)List of Unique Integers (FXCUP4_unique)C++17
0 / 100
6 ms384 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; std::vector<int> PickUnique(int N) { vector<int> ans(N, 1); vector<int> a(N) , b(N); for(int i = 0 ; i < N ; i ++){ a[i] = UniqueCount(0 , i ); b[i] = UniqueCount(N - i - 1 , N - 1); } for(int i = 1 ; i < N ; i ++){ if(a[i] < a[i-1]) ans[i] = false; } for(int i = 1 ; i < N ; i ++){ if(b[i] < b[i-1]) ans[N-i-1] = false; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...