Submission #256507

#TimeUsernameProblemLanguageResultExecution timeMemory
256507KastandaList of Unique Integers (FXCUP4_unique)C++17
0 / 100
1 ms256 KiB
// 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 timeMemoryGrader output
Fetching results...