# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1202173 | dzuizz | Permutation (APIO22_perm) | C++20 | 7 ms | 1480 KiB |
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> construct_permutation(long long k){
--k;
vector<int> p;
int n=0;
for(int j=59;j>0;--j){
long long x=(1ll<<j); --x;
if(x<=k){
k-=x;
for(int i=n+j-1;i>=n;--i){
p.emplace_back(i);
}
n+=j++;
}
}
reverse(p.begin(),p.end());
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |