제출 #1107105

#제출 시각아이디문제언어결과실행 시간메모리
1107105vladilius순열 (APIO22_perm)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define pb push_back #define ff first #define ss second vector<int> construct_permutation(ll k){ vector<int> p; int cc = 0; for (int i = 0; i < k % 3; i++){ p.pb(1e9); } p.pb(cc++); k -= k % 3; k = k / 3 - 1; while (k > 0){ for (int i = 0; i < 2 - k % 3; i++){ p.pb(1e9); } p.pb(cc++); k /= 3; } for (int i = (int) p.size() - 1; i >= 0; i--){ if (p[i] == 1e9){ p[i] = cc++; } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...