# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1132904 | rotated | List of Unique Integers (FXCUP4_unique) | C++20 | 1 ms | 588 KiB |
#include "unique.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> PickUnique(int N) {
int lcount[N];
int rcount[N];
vector<int> ans;
for (int i = 0; i < N; i++) ans.push_back(1);
for (int i = 0; i < N; i++) {
lcount[i] = UniqueCount(0, i);
rcount[i] = UniqueCount(i, N - 1);
}
for (int i = 1; i < N; i++) {
if (lcount[i] != lcount[i-1] + 1) ans[i] = 0;
}
for (int i = 0; i < N-1; i++) {
if (rcount[i] != rcount[i+1] + 1) ans[i] = 0;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |