제출 #1331609

#제출 시각아이디문제언어결과실행 시간메모리
1331609kenkunkinList of Unique Integers (FXCUP4_unique)C++20
0 / 100
1 ms344 KiB
#include <bits/stdc++.h>
#include "unique.h"

using namespace std;

vector <int> PickUnique(int n)
{
    vector <int> a(n);
    for (int i=0;i<n;i++)   a[i]=1;
    int u=1;
    for (int i=1;i<n;i++)
    {
        int hi=UniqueCount(0,i);
        if (hi<=u)
            a[i]=0;
        u=hi;
    }

    u=1;
    for (int i=n-1;i>=0;i--)
    {
        int hi=UniqueCount(i,n-1);
        if (hi<=u)
            a[i]=0;
        u=hi;
    }
    return a;
}
#Verdict Execution timeMemoryGrader output
Fetching results...