# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744849 | merlynn | Permutation (APIO22_perm) | C++17 | 2 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
vector<int32_t> construct_permutation(long long k) {
string bn="";
while(k)
{
bn+=k%2+'0';
k/=2;
}
reverse(bn.begin(),bn.end());
vector<int32_t> ret;
int cur=0;
for(int i=1;i<bn.size();i++)
{
ret.push_back(cur++);
if(bn[i]=='1')
ret.insert(ret.begin(),cur++);
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |