제출 #577300

#제출 시각아이디문제언어결과실행 시간메모리
577300handlename순열 (APIO22_perm)C++17
91.33 / 100
2 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair const int MOD=1e9+7; long long num[63]; vector<int> construct_permutation(long long k){ k--; num[0]=1; for (int i=1;i<63;i++){ num[i]=num[i-1]*2; } vector<int> res; int cur=0; while (k>0){ int pos=min((int)res.size(),62); while (k<num[pos]) pos--; res.insert(res.begin()+pos,cur); k-=num[pos]; cur++; } assert(res.size()<=128); return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...