18 lines
670 B
C++
18 lines
670 B
C++
const long long L = 1, R = 10;
|
|
|
|
random_device rd; mt19937 rng(rd());
|
|
uniform_int_distribution<int> dist(L, R);
|
|
// discrete_distribution<int> dist({10, 30, 60}); // [0, 2]
|
|
// bernoulli_distribution dist(p); // true(p), false(1-p)
|
|
// binomial_distribution<int> dist(N, p); // # of success
|
|
// geometric_distribution<int> dist(p); // # of failure
|
|
|
|
// uniform_real_distribution<double> dist(L, R);
|
|
// normal_distribution<double> dist(mean, std);
|
|
// exponential_distribution<double> dist(lambda); // occur time
|
|
// poisson_distribution<int> dist(lambda); // how many?
|
|
// chi_squared_distribution<double> dist(df); // 자유도
|
|
|
|
auto gen = bind(dist, rng);
|
|
|
|
gen(); gen(); gen(); |