Submission #1130515

#TimeUsernameProblemLanguageResultExecution timeMemory
1130515ooscodePermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
int[] construct_permutation(int64 k) { vector<pair<pair<int , int> , int>> vec; for(int i = 60 ; ~i ; i++) if((1ll << i) & k) { if(vec.size()) vec.pb({{i + 1 , 0} , vec.size()}); else for(int j = 1 ; j <= i ; j++) vec.pb({{j , 1} , vec.size()}); } sort(all(vec)); int a[vec.size()]; for(int i = 0 ; i < vec.size() ; i++) a[vec[i].S] = i; return a; }

Compilation message (stderr)

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