# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149364 | Ragtag Volunteers (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 640 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"
std::vector<std::vector<int> > mem;
int querry(int l, int r) {
if (r < l) return 0;
if (r == l) return 1;
int &res = mem[l][r];
if (res != -1) return res;
res = UniqueCount(l, r);
return res;
}
std::vector<int> PickUnique(int n) {
mem.assign(n, std::vector<int>(n, -1));
std::vector<int> res(n);
for (int i = 0; i < n; i++) {
const int del_l = querry(0, i) - querry(0, i - 1),
del_r = querry(i, n - 1) - querry(i + 1, n - 1);
res[i] = del_l == 1 and del_r == 1;
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |