# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
742580 | fanwen | Permutation (APIO22_perm) | C++17 | 2 ms | 376 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>
#include "perm.h"
using namespace std;
vector<int> construct_permutation(long long k) {
string bn="";
while(k)
{
bn+=k%2+'0';
k/=2;
}
reverse(bn.begin(),bn.end());
vector<int> 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... |