제출 #709727

#제출 시각아이디문제언어결과실행 시간메모리
709727gun_gan순열 (APIO22_perm)C++17
0 / 100
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> construct_permutation(long long k) { vector<vector<int>> ans; k--; int last = 0; for(int i = 59; i >= 0; i -= 5) { ll cur = 0; for(int j = i, z = 4; j > i - 5; j--, z--) { cur += (k >> j & 1) << z; } if(cur > 0) { ans.push_back({}); for(int j = 0; j < i - 4; j++) { ans.back().push_back(last); last++; } for(int j = 0; j < cur; j++) { ans.back().push_back(last + cur - j - 1); } last += cur; } } vector<int> ret; for(auto x : ans) { for(auto i : x) ret.push_back(i); } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...