Submission #583991

# Submission time Handle Problem Language Result Execution time Memory
583991 2022-06-26T15:56:16 Z YassineBenYounes Permutation (APIO22_perm) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;

int[] construct_permutation(long long k){
     k--;
     k--;
     int arr[k+1];
     int index = 0;
     for(int i = k; i >= 0;i--){
        arr[index] = i;
        index++;
     }
     return arr;
}

Compilation message

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