Submission #1118733

#TimeUsernameProblemLanguageResultExecution timeMemory
1118733Username_taken12Permutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
vector<int> construct_permuation(long long k) { int cnt = popcount((unsigned long long) k); int size =0; long long t=k; while(t>0){ size++; t/=2; } int len = size+cnt; int h=len; int a =1; vector<int> out; while(k>0){ if(k%2==1) out.push_back(h--); out.push_back(a++); k/=2; } return out; }

Compilation message (stderr)

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