제출 #702337

#제출 시각아이디문제언어결과실행 시간메모리
702337safaricola순열 (APIO22_perm)C++17
10 / 100
244 ms262144 KiB
#include<bits/stdc++.h> #include "perm.h" using namespace std; vector<int> construct_permutation(long long k){ vector<int> v; int cur=1,i=0; while(cur*2<k){ cur*=2; v.push_back(i); i++; } k-=cur; while(k > 0){ cur=1; int pos=0; while(cur*2<=k)pos++,cur*=2; v.insert(v.begin()+pos,i);i++; k-=cur; } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...