Submission #738747

#TimeUsernameProblemLanguageResultExecution timeMemory
738747shantolPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include "perm.h" #include<bits/stdc++.h> #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #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; }

Compilation message (stderr)

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