제출 #582682

#제출 시각아이디문제언어결과실행 시간메모리
582682Vanilla순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int>
construct_permutation(ll k)
{
    --k;
    int m = 1;

    while(k+1 > (1ll<<(m))) {
        ++m;
    }

    vector<int> perm(m);

    for (int i = 0; i < m; ++i) {
        perm[i] = i;
    }

    for (int i = m-2; i >= 0; --i) {
        if ((k & (1ll << i)) == 0)
            swap(perm[i],perm[i+1]);
    }

    return perm;
}

컴파일 시 표준 에러 (stderr) 메시지

perm.cpp:5:23: error: 'll' was not declared in this scope
    5 | construct_permutation(ll k)
      |                       ^~
perm.cpp:6:1: error: expected ',' or ';' before '{' token
    6 | {
      | ^