Submission #149364

#TimeUsernameProblemLanguageResultExecution timeMemory
149364Ragtag Volunteers (#200)List of Unique Integers (FXCUP4_unique)C++17
100 / 100
6 ms640 KiB
#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 timeMemoryGrader output
Fetching results...