# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151962 | minty99 | List of Unique Integers (FXCUP4_unique) | C++17 | 2 ms | 632 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> U(N);
int uc0[200], ucN[200];
for(int i = 0; i < N; i++)
{
uc0[i] = UniqueCount(0, i);
ucN[i] = UniqueCount(i, N-1);
}
for(int i = 0; i < N; i++)
{
if(i == 0)
U[i] = ucN[i] > ucN[i+1] ? 1 : 0;
else if(i == N-1)
U[i] = uc0[i] > uc0[i-1] ? 1 : 0;
else
U[i] = (uc0[i] > uc0[i-1] && ucN[i] > ucN[i+1]) ? 1 : 0;
}
return U;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |