제출 #593416

#제출 시각아이디문제언어결과실행 시간메모리
593416mohammad_kilani순열 (APIO22_perm)C++17
71.22 / 100
11 ms1364 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k){ vector< int > arr; k--; for(long long i = 61;i > 0;i--){ while((1LL << i) - 1 <= k){ k -= (1LL << i) - 1; for(int j = 0 ;j < i;j++){ arr.push_back((int)arr.size() - j + (i - j - 1)); } } } reverse(arr.begin(),arr.end()); return arr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...