Submission #722343

# Submission time Handle Problem Language Result Execution time Memory
722343 2023-04-11T18:57:34 Z tvladm2009 List of Unique Integers (FXCUP4_unique) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "unique.h"

using namespace std;

typedef long long ll;

const int N_MAX = 200;

int pref[N_MAX + 2], suff[N_MAX + 2];
bool answer[N_MAX + 2];

int[] PickUnique(int N) {
    for (int i = 1; i <= N; i++) {
        pref[i] = UniqueCount(0, i - 1);
    }
    for (int i = N; i >= 1; i--) {
        suff[i] = UniqueCount(i - 1, N - 1);
    }
    for (int i = 1; i <= N; i++) {
        if (pref[i] == pref[i - 1] + 1 && suff[i] == suff[i + 1] + 1) {
            answer[i - 1] = 1;
        } else {
            answer[i - 1] = 0;
        }
    }
    return answer;
}

Compilation message

unique.cpp:13:4: error: structured binding declaration cannot have type 'int'
   13 | int[] PickUnique(int N) {
      |    ^~
unique.cpp:13:4: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
unique.cpp:13:4: error: empty structured binding declaration
unique.cpp:13:7: error: expected initializer before 'PickUnique'
   13 | int[] PickUnique(int N) {
      |       ^~~~~~~~~~