| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366712 | ezzzay | 순열 (APIO22_perm) | C++20 | 4 ms | 1348 KiB |
#include "perm.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
std::vector<int> construct_permutation(long long k){
k--;
vector<int>vc;
int n=0;
while(k){
for(int i=60;i>=1;i--){
if( k>= (1ll<<i)-1){
k-=(1ll<<i)-1 ;
n+=i;
vc.pb(i);
break;
}
}
}
n--;
vector<int>ans;
for(auto a:vc){
for(int j=a-1;j>=0;j--){
ans.pb(n-j);
}
n-=a;
}
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
