Submission #970697

#TimeUsernameProblemLanguageResultExecution timeMemory
970697mannshah1211Permutation (APIO22_perm)C++17
0 / 100
0 ms344 KiB
#include "perm.h" using namespace std; vector<int> construct_permutation(long long k) { if (k == 2) { return vector<int>(1, 0); } if (k % 2 == 1) { vector<int> bef = construct_permutation(k - 1); vector<int> ans = bef; for (int &v : ans) { v++; } ans.push_back(0); } else { vector<int> bef = construct_permutation(k / 2); vector<int> ans = bef; ans.push_back(ans.size()); } }

Compilation message (stderr)

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...