Submission #998560

#TimeUsernameProblemLanguageResultExecution timeMemory
99856012345678List of Unique Integers (FXCUP4_unique)C++17
100 / 100
1 ms856 KiB
#include "unique.h" #include <bits/stdc++.h> using namespace std; std::vector<int> PickUnique(int N) { int p=0; vector<int> cnt(N), res(N); for (int i=0; i<N; i++) { int c=UniqueCount(0, i); if (c>p) cnt[i]++; p=c; } p=0; for (int i=N-1; i>=0; i--) { int c=UniqueCount(i, N-1); if (c>p) cnt[i]++; p=c; } for (int i=0; i<N; i++) res[i]=cnt[i]==2; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...