제출 #954941

#제출 시각아이디문제언어결과실행 시간메모리
954941horiseun순열 (APIO22_perm)C++17
91.33 / 100
2 ms348 KiB
#include <iostream> #include <vector> #include <numeric> #include <algorithm> #include "perm.h" using namespace std; #define ll long long vector<int> construct_permutation(ll k) { int curr = 0; for (int i = 59; i >= 0; i--) { if (k & (1ll << i)) { curr = i; break; } } vector<int> ret(curr); iota(ret.begin(), ret.end(), 0); for (int i = curr - 1; i >= 0; i--) { if (k & (1ll << i)) { ret.insert(ret.begin() + i, curr); curr++; } } return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...