Submission #247092

#TimeUsernameProblemLanguageResultExecution timeMemory
247092tqbfjotldList of Unique Integers (FXCUP4_unique)C++17
100 / 100
5 ms512 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; int arr1[205]; int arr2[205]; std::vector<int> PickUnique(int N) { arr1[0] = 1; arr2[N-1] = 1; for (int x = 1; x<N; x++){ arr1[x] = UniqueCount(0,x); } for (int x = 0; x<N-1; x++){ arr2[x] = UniqueCount(x,N-1); } vector<int> ans; if (arr2[0]>arr2[1]){ ans.push_back(1); } else{ ans.push_back(0); } for (int x = 1; x<N-1; x++){ if (arr2[x]>arr2[x+1] && arr1[x]>arr1[x-1]){ ans.push_back(1); } else{ ans.push_back(0); } } if (arr1[N-1]>arr1[N-2]){ ans.push_back(1); } else{ ans.push_back(0); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...