# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148949 | (대충 적당한 팀명) (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 5 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.
#include "unique.h"
std::vector<int> PickUnique(int N)
{
std::vector<int> arr1, arr2;
int front = 0, end = N - 1;
int count = UniqueCount(0, N-1);
while (front < N / 2) {
front++;
int ucount = UniqueCount(front, N-1);
if (ucount >= count) {
arr1.push_back(0);
}
else {
arr1.push_back(1);
}
count = ucount;
if (N % 2 == 1) {
ucount = UniqueCount(front + 1, N - 1);
if (ucount >= count) {
arr1.push_back(0);
}
else {
arr1.push_back(1);
}
}
}
count = UniqueCount(0, N-1);
while (end > N / 2) {
end--;
int ucount = UniqueCount(0, end);
if (ucount >= count) {
arr2.push_back(0);
}
else {
arr2.push_back(1);
}
count = ucount;
}
while (!arr2.empty()) {
arr1.push_back(arr2.back());
arr2.pop_back();
}
return arr1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |