Submission #247100

#TimeUsernameProblemLanguageResultExecution timeMemory
247100lycList of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms512 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<=(b);++i) const int mxN = 205; int pre[mxN], suf[mxN]; std::vector<int> PickUnique(int N) { FOR(i,0,N-1){ pre[i] = UniqueCount(0,i); suf[N-1-i] = UniqueCount(N-1-i,N-1); } vector<int> ans(N); FOR(i,0,N-1){ ans[i] = (i == 0 ? 1 : (pre[i]>pre[i-1])) && (i == N-1 ? 1 : (suf[i]>suf[i+1])); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...