# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
148945 | 샌즈뼈 (#200) | List of Unique Integers (FXCUP4_unique) | C++17 | 6 ms | 512 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"
using namespace std;
std::vector<int> PickUnique(int N)
{
vector<int> ans(N,0);
int i,j,v1,v2;
int base = UniqueCount(0,N-1);
int f[211]={};
v1=base;
for (i=1;i<N-1;i++)
{
v2=UniqueCount(i,N-1);
if (v1>v2) f[i-1]++;
v1=v2;
}
if (v1==2) f[N-2]++;
v1=base;
for (i=N-2;i>=1;i--)
{
v2=UniqueCount(0,i);
if (v1>v2) f[i+1]++;
v1=v2;
}
if (v1==2) f[1]++;
for (i=1;i<N-1;i++) if (f[i]==2) ans[i]=1;
if (f[0]==1) ans[0]=1;
if (f[N-1]==1) ans[N-1]=1;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |