# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
247088 | shenxy | List of Unique Integers (FXCUP4_unique) | C++17 | 5 ms | 768 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 <algorithm>
#include <vector>
#include <set>
using namespace std;
vector<int> PickUnique(int N) {
bool preun[N], postun[N];
fill_n(preun, N, false);
fill_n(postun, N, false);
int pre = 0;
for (int i = 0; i < N; ++i) {
int k = UniqueCount(0, i);
if (k > pre) preun[i] = true;
pre = k;
}
pre = 0;
for (int i = N - 1; i >= 0; --i) {
int k = UniqueCount(i, N - 1);
if (k > pre) postun[i] = true;
pre = k;
}
vector<int> ans;
for (int i = 0; i < N; ++i) {
if (preun[i] && postun[i]) ans.push_back(1);
else ans.push_back(0);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |