제출 #601279

#제출 시각아이디문제언어결과실행 시간메모리
601279doowey순열 (APIO22_perm)C++17
91.33 / 100
3 ms376 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair vector<int> construct_permutation(ll k) { if(k == 1) return {}; if(k % 2 == 1){ vector<int> sol = construct_permutation(k - 1); vector<int> res; res.push_back(sol.size()); for(auto x : sol) res.push_back(x); return res; } else{ vector<int> sol = construct_permutation(k / 2ll); sol.push_back(sol.size()); return sol; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...