Submission #256506

# Submission time Handle Problem Language Result Execution time Memory
256506 2020-08-02T19:04:19 Z Kastanda List of Unique Integers (FXCUP4_unique) C++17
Compilation error
0 ms 0 KB
// M
#include<bits/stdc++.h>
using namespace std;
int n;
int Get(int l, int r)
{
        l --; r --;
        l = max(l, 0);
        r = min(r, n - 1);
        if (r < l)
                return 0;
        return UniqueCount(l, r);
}
vector < int > PickUnique(int _n)
{
        n = _n;
        vector < int > P(n + 1, 0), S(n + 1, 0);
        for (int i = 1; i <= n; i ++)
                P[i] = Get(1, i), S[i] = Get(i, n);
        vector < int > U;
        for (int i = 1; i <= n; i ++)
                if (P[i] == P[i - 1] + 1 && S[i] == S[i + 1] + 1)
                        U.push_back(i - 1);
        return U;
}

Compilation message

unique.cpp: In function 'int Get(int, int)':
unique.cpp:12:16: error: 'UniqueCount' was not declared in this scope
         return UniqueCount(l, r);
                ^~~~~~~~~~~