제출 #738749

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

#define ll long long

vector<int> construct_permutation(ll k){
    vector<int> ans;
    k--;
    for(ll p=1, i=0;p<=k;i++,p=(p<<1)|1){
        ans.pb(i);
    }
    ll p=ans.sz;
    vector<vector<int>> v(p+1);
    k=k-(1<<p)+1;
    for(int i=ans.sz-1;i>=0;i--){
        while(k>=(1<<i)){
            v[i].pb(p++);
            k-=(1<<i);
        }
    }
    vector<int> val;
    for(int i=0;i<ans.sz;i++){
        for(int j:v[i])val.pb(j);
        val.pb(ans[i]);
    }
    return val;
}

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

perm.cpp:6:1: error: 'vector' does not name a type
    6 | vector<int> construct_permutation(ll k){
      | ^~~~~~