Submission #975928

# Submission time Handle Problem Language Result Execution time Memory
975928 2024-05-06T03:33:32 Z Orifkhon Permutation (APIO22_perm) C++17
Compilation error
0 ms 0 KB
int[] construct_permutation(long long k) {
  int z = __lg(k);
  vector<int> p(z);
  iota(p.begin(), p.end(), 0);
  for (int i = z - 1; i >= 0; i--) {
    if ((k >> i) & 1) {
      p.insert(p.begin() + i, z++);
    }
  }
  return p;
}

Compilation message

perm.cpp:1:4: error: structured binding declaration cannot have type 'int'
    1 | int[] construct_permutation(long long 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(long long k) {
      |       ^~~~~~~~~~~~~~~~~~~~~