Submission #247087

#TimeUsernameProblemLanguageResultExecution timeMemory
247087dantoh000List of Unique Integers (FXCUP4_unique)C++17
100 / 100
5 ms512 KiB
#include <bits/stdc++.h> #include "unique.h" using namespace std; vector<int> PickUnique(int N){ vector<int> U(N); int Ql[N], Qr[N]; for (int i = 0; i < N; i++){ Ql[i] = UniqueCount(0,i); Qr[i] = UniqueCount(i,N-1); } for (int i = 0; i < N; i++){ if ((i == 0 || Ql[i] == Ql[i-1]+1) && (i == N-1 || Qr[i] == Qr[i+1]+1)){ U[i] = 1; } else U[i] = 0; } return U; }
#Verdict Execution timeMemoryGrader output
Fetching results...