This documentation is automatically generated by online-judge-tools/verification-helper
#include "Src/Random/RandomPermutation.hpp"
#pragma once
#include "../Template/TypeAlias.hpp"
#include <algorithm>
#include <cassert>
#include <concepts>
#include <numeric>
#include <vector>
#include <random>
namespace zawa {
namespace Random {
// [0 .. n)
template <std::integral T>
std::vector<T> Permutation(usize n) {
std::mt19937_64 mt{std::random_device{}()};
std::vector<T> res(n);
std::iota(res.begin(), res.end(), T{0});
std::ranges::shuffle(res, mt);
return res;
}
} // namespace Random
} // namespace zawa
#line 2 "Src/Random/RandomPermutation.hpp"
#line 2 "Src/Template/TypeAlias.hpp"
#include <cstdint>
#include <cstddef>
namespace zawa {
using i16 = std::int16_t;
using i32 = std::int32_t;
using i64 = std::int64_t;
using i128 = __int128_t;
using u8 = std::uint8_t;
using u16 = std::uint16_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;
using usize = std::size_t;
} // namespace zawa
#line 4 "Src/Random/RandomPermutation.hpp"
#include <algorithm>
#include <cassert>
#include <concepts>
#include <numeric>
#include <vector>
#include <random>
namespace zawa {
namespace Random {
// [0 .. n)
template <std::integral T>
std::vector<T> Permutation(usize n) {
std::mt19937_64 mt{std::random_device{}()};
std::vector<T> res(n);
std::iota(res.begin(), res.end(), T{0});
std::ranges::shuffle(res, mt);
return res;
}
} // namespace Random
} // namespace zawa