제출 #862381

#제출 시각아이디문제언어결과실행 시간메모리
862381JakobZorz순열 (APIO22_perm)C++17
71.22 / 100
10 ms1324 KiB
#include<iostream> #include"perm.h" using namespace std; typedef long long ll; vector<int>construct_permutation(ll k){ k--; vector<int>res; for(int i=63;i>0;i--){ while((1LL<<i)-1<=k){ k-=(1LL<<i)-1; int start=(int)res.size(); int end=start+i; for(int j=end-1;j>=start;j--) res.push_back(j); } } for(int&i:res){ i=(int)res.size()-i-1; //cout<<i<<" "; } //cout<<"\n"; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...