제출 #1312314

#제출 시각아이디문제언어결과실행 시간메모리
1312314lmaobruh순열 (APIO22_perm)C++20
10 / 100
1095 ms5640 KiB
#include <bits/stdc++.h>
#include "perm.h"
using namespace std;
#define ll long long
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
#define ii pair<int,int>
#define ve vector
#define all(x) x.begin(), x.end()
#define fo(i,a,b) for (int i=(a); i<=(b); ++i)
#define fd(i,a,b) for (int i=(a); i>=(b); --i)
#define popcount(x) __builtin_popcountll(x)
#define maxi(a, b) a = max(a, b)
#define mini(a, b) a = min(a, b)
#define siz(x) ((int)(x).size())
#define vi ve<int>
#define _ << ' ' << 

const int N = 1e6+5, inf = 1e9+10, mod = 1e9+7;
const ll lim = 1e18+5;

mt19937_64 rng((ll)(new char));

int rand(int l, int r) {
    return rng() % (r - l + 1) + l;
}

vi construct_permutation(ll k) {
    assert(k > 0);
    if (k == 1) return {};
    if (k == 2) return {0};
    int sub = rand(0, 10);
    while (sub >= k) sub = rand(1, 10);
    vi res = construct_permutation(k - sub);
    fo(i,1,sub) res.insert(res.begin(), siz(res));
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...