제출 #595077

#제출 시각아이디문제언어결과실행 시간메모리
595077Andyvanh1순열 (APIO22_perm)C++17
91.33 / 100
3 ms340 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k){ int Max = 0; int cur = 0; for(int i = 0; i < 60; i++){ if((((long long)1)<<i)&k){ Max = i; cur++; } } cur--; vector<int> ans; for(int i = 0; i < Max; i++){ if((((long long)1)<<i)&k){ cur--; ans.push_back(Max+cur); } ans.push_back(i); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...