Submission #796678

#TimeUsernameProblemLanguageResultExecution timeMemory
796678Trisanu_DasPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<int> construct_permutation(int k){ vector<int> ans; long long pow_2 = 1, exp_2 = 0, flag = 0, curr = 0; while(pow_2 * 2 <= k) pow_2 *= 2, exp_2++; for(int i = exp_2 - 1; i > -1; i--){ ans.push_back(curr++); if((k >> i) & 1){ if(i and (k >> (i-1) & 1) and flag > 1) ans.push_back(curr++), ans.insert(ans.begin() + 2, curr++), i--; else ans.insert(ans.begin(), curr++), flag++; } } return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccLAdPCK.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status