Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
RandomGenerator 名前空間

ランダムテストケース生成 [詳解]

関数

template<typename T>
RandomInt (T n)
 0 以上 n 未満のランダムな整数を返す
 
template<typename T>
RandomInt (T l, T r)
 [l, r) の範囲からランダムな整数を返す
 
template<typename T>
GetRandomElement (vector< T > &a)
 配列 a からランダムな要素を取得し、削除する
 
template<typename T>
vector< T > RandomArray (int n, T lo, T hi, bool no_dup=false)
 長さ n の [lo, hi) の要素からなるランダムな数列を返す
 
string RandomAlphabet (int n, bool lower=true)
 ランダムなアルファベット文字列を返す
 
string RandomString (int n, string s)
 文字列 s の要素からなるランダムな文字列を返す
 
template<typename T>
vector< vector< T > > RandomArray2D (int h, int w, T lo, T hi)
 
vector< string > RandomAlphabet2D (int h, int w, bool lower=true)
 
vector< pair< int, int > > RandomTree (int n)
 
vector< pair< int, int > > RandomBinaryTree (int n)
 
vector< pair< int, int > > RandomUndirectedGraph (int n, int m, bool connected=true)
 

詳解

ランダムテストケース生成

関数詳解

◆ RandomInt() [1/2]

template<typename T>
T RandomGenerator::RandomInt ( T n)

0 以上 n 未満のランダムな整数を返す

random.hpp9 行目に定義があります。

◆ RandomInt() [2/2]

template<typename T>
T RandomGenerator::RandomInt ( T l,
T r )

[l, r) の範囲からランダムな整数を返す

random.hpp13 行目に定義があります。

◆ GetRandomElement()

template<typename T>
T RandomGenerator::GetRandomElement ( vector< T > & a)

配列 a からランダムな要素を取得し、削除する

random.hpp17 行目に定義があります。

◆ RandomArray()

template<typename T>
vector< T > RandomGenerator::RandomArray ( int n,
T lo,
T hi,
bool no_dup = false )

長さ n の [lo, hi) の要素からなるランダムな数列を返す

引数
no_dupfalse の場合、重複要素を許容する

random.hpp29 行目に定義があります。

◆ RandomAlphabet()

string RandomGenerator::RandomAlphabet ( int n,
bool lower = true )

ランダムなアルファベット文字列を返す

引数
lower小文字

random.hpp46 行目に定義があります。

◆ RandomString()

string RandomGenerator::RandomString ( int n,
string s )

文字列 s の要素からなるランダムな文字列を返す

random.hpp56 行目に定義があります。

◆ RandomArray2D()

template<typename T>
vector< vector< T > > RandomGenerator::RandomArray2D ( int h,
int w,
T lo,
T hi )

random.hpp67 行目に定義があります。

◆ RandomAlphabet2D()

vector< string > RandomGenerator::RandomAlphabet2D ( int h,
int w,
bool lower = true )

random.hpp73 行目に定義があります。

◆ RandomTree()

vector< pair< int, int > > RandomGenerator::RandomTree ( int n)

random.hpp79 行目に定義があります。

◆ RandomBinaryTree()

vector< pair< int, int > > RandomGenerator::RandomBinaryTree ( int n)

random.hpp105 行目に定義があります。

◆ RandomUndirectedGraph()

vector< pair< int, int > > RandomGenerator::RandomUndirectedGraph ( int n,
int m,
bool connected = true )

random.hpp123 行目に定義があります。