# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744852 | merlynn | Permutation (APIO22_perm) | C++17 | 0 ms | 212 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<int64_t> construct_permutation(long long k) {
string bn="";
while(k)
{
bn+=k%2+'0';
k/=2;
}
reverse(bn.begin(),bn.end());
vector<int64_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... |