# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256510 | Kastanda | List of Unique Integers (FXCUP4_unique) | C++17 | 0 ms | 256 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.
// M
#include<bits/stdc++.h>
#include "unique.h"
using namespace std;
int n;
int Get(int l, int r)
{
l --; r --;
l = max(l, 0);
r = min(r, n - 1);
if (r < l)
return 0;
return UniqueCount(l, r);
}
vector < int > PickUnique(int _n)
{
n = _n;
vector < int > P(n + 1, 0), S(n + 1, 0);
for (int i = 1; i <= n; i ++)
P[i] = Get(1, i), S[i] = Get(i, n);
vector < int > U;
for (int i = 1; i <= n; i ++)
if (P[i] == P[i - 1] + 1 && S[i] == S[i + 1] + 1)
U.push_back(i - 1);
return U;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |