# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149033 | dragoon (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "unique.h"
#include<vector>
#include<stdio.h>
using namespace std;
std::vector<int> PickUnique(int N) {
vector<int> V(N), pre(N + 2), suf(N + 2);
for (int i = 0; i < N; i++) {
pre[i] = UniqueCount(0, i);
suf[i] = UniqueCount(i, N - 1);
}
for (int i = 0; i < N; i++) {
int p = (i ? pre[i - 1] : 0);
int s = (i == N - 1 ? 0 : suf[i + 1]);
//printf("%d %d %d %d\n", pre[i], p, suf[i], s);
V[i] = ((pre[i] - 1 == p) && (suf[i] - 1 == s)) ? 1 : 0;
}
return V;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |