# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148537 | TeamSUA (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 592 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
std::vector<int> PickUnique(int N) {
int n = N;
vector<int> f(n, 0);
int total = UniqueCount(0, n - 1);
int now = total;
for (int i = 1; i < n; i++) {
int tmp = UniqueCount(i, n - 1);
if (now == tmp + 1) f[i - 1]++;
now = tmp;
}
now = total;
for (int i = n - 2; i >= 0; i--) {
int tmp = UniqueCount(0, i);
if (now == tmp + 1) f[i + 1]++;
now = tmp;
}
f[n - 1]++;
f[0]++;
vector<int> ans;
for (int i = 0; i < n; i++)
if (f[i] == 2)
ans.push_back(1);
else ans.push_back(0);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |