Submission #740930

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7409302023-05-13 09:41:38enerelt14Permutation (APIO22_perm)C++17
100 / 100
2 ms340 KiB
#include "perm.h"
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
vector<int> x;
int n;
vector<int> construct_permutation(ll k){
if (k == 1)return {};
if (k == 2)return {0};
if (k == 3)return {1, 0};
if (k % 4 == 0){
x = construct_permutation(k / 4);
n = x.size();
x.pb(n);
x.pb(n + 1);
return x;
}
if (k % 4 == 1){
x = construct_permutation(k / 4);
n = x.size();
for (int i = 0; i < n; i++)x[i]++;
x.pb(n + 1);
x.pb(n + 2);
x.pb(0);
return x;
}
if (k % 4 == 2){
x = construct_permutation(k / 4);
n = x.size();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...