# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1199494 | user149 | 순열 (APIO22_perm) | C++20 | 8 ms | 1600 KiB |
#include<bits/stdc++.h>
#include "perm.h"
using namespace std;
using ll=long long;
vector<int> construct_permutation(ll k){
k--;
int n=0;
for(int j=0;j<=60;j++){
if(k & (1ll<<j)) n+=(j+1);
}
vector<int> ans;
int cur=n-1;
for(int j=0;j<=60;j++){
if(k & (1ll<<j)){
ans.push_back(cur);
for(int i=cur-j;i<=cur-1;i++) ans.push_back(i);
cur-=j;
cur--;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |