제출 #1357764

#제출 시각아이디문제언어결과실행 시간메모리
1357764channk순열 (APIO22_perm)C++20
91.33 / 100
1 ms344 KiB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,O3,unroll-loops")
#pragma GCC target("avx,avx2,fma") 
#define ll long long
#define gcd __gcd
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ts cin.tie(nullptr)->sync_with_stdio(false);
#define debug cout<<"HI"<<endl;
const int inf = 1e9;
const ll infll = 1e18;
 
using namespace std;

vector<int> construct_permutation(ll k){
    if(k==1) return {};
    if(k%2==0){
        auto a=construct_permutation(k/2);
        a.push_back(a.size());
        return a;
    } else {
        auto a=construct_permutation(k-1);
        a.insert(a.begin(), a.size());
        return a;
    }
}

// int main(){
//     ts
//     ll n; cin >> n;
//     auto v = construct_permutation(n);
//     for(auto &i:v) cout << i << " ";
//     return 0;
// }
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…