Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
xor128.hpp
[詳解]
1#pragma once
2#include"../../kyopro_library/template.hpp"
3
4using ull=unsigned long long;
5/// @brief 疑似乱数生成
6ull Xor128() {
7 static bool flag=false;
8 static ull x=123456789,y=362436069,z=521288629,w=88675123;
9 if(!flag) {
10 random_device seedgen;
11 w=seedgen();
12 flag=true;
13 }
14 ull t=x^(x<<11);
15 x=y,y=z,z=w;
16 return w=(w^(w>>19))^(t^(t>>8));
17}
18ll Xor128(ll n) { return Xor128()%n; }
19ll Xor128(ll l, ll r) { return Xor128(r-l)+l; }//[l,r)
20double Xor128Prob() { return (double)Xor128()/(ULLONG_MAX); }
ll Xor128(ll l, ll r)
Definition xor128.hpp:19
double Xor128Prob()
Definition xor128.hpp:20
ull Xor128()
疑似乱数生成
Definition xor128.hpp:6
ll Xor128(ll n)
Definition xor128.hpp:18