// 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 + 2, 0), S(n + 2, 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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Wrong |
2 |
Halted |
0 ms |
0 KB |
- |