제출 #982841

#제출 시각아이디문제언어결과실행 시간메모리
982841alo_54순열 (APIO22_perm)C++17
0 / 100
0 ms348 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k) { vector <int> resp; long long pot = 0, prev = 1; while (prev <= k) { pot = prev; prev *= 2; } long long diff = k - pot; for (long long i =(long long) (pot + diff) ; i > pot; i--) { resp.push_back(i); } for (int i = 0; i <= pot; i++) { resp.push_back(i); } return resp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...