Submission #1101726

#TimeUsernameProblemLanguageResultExecution timeMemory
1101726rayan_bdList of Unique Integers (FXCUP4_unique)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; std::vector<int> PickUnique(int N){ vector<int> ans(N,0); for(int i=0;i<N;++i){ int lft=0,rgt=0,c_with_lft=0,c_with_rgt=0; if(i>0) lft=UniqueCount(0,i-1); if(i+1<N) rgt=UniqueCount(i+1,N); c_with_lft=UniqueCount(0,i); c_with_rgt=UniqueCount(i,N); if(lft<c_with_lft&&rgt<c_with_rgt){ ans[i]=1; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...