toString
- number to string
toHumanReadableString
- number to string in human readable (scientific) notation
rnd.next(n)
-> random number from interval
rnd.next(a,b)
-> random number from interval
rnd.wnext(n, k)
-> random number from interval
rnd.any(begin, end)
-> random value from iterator interval
rnd.wany(begin, end)
-> random value from iterator interval (with distribution, simililar to rnd.wnext
)
rnd.perm(n, first)
-> permutation of size
rnd.distinct(n, a, b)
->
rnd.distinct(n, lim)
->
rnd.partition(n, sum, mini)
->
rnd.partition(n, sum)
->
pattern:
next(rnd)
-> generated string matching patternmatches(str)
-> check if matches
trim(str)
-> string with trimed whitespace
registerGen(seed)
-> register generator with seed equal to
split(str, separators)
-> splits string on every occurance of a character in
println(x)
-> cout << x << endl;
println(a,b)
-> cout << a << ' ' << b << endl;
itd.
println(begin, end)
-> prints values from a interval of iterators
Class for graph structure
- construction of random graphs
- clique
- silkworm
- jellyfish
- forest (trivial and prufer codes)
- paths
- starfish
- bounded degree trees
- formatting and printing
- some helper functions
#include "testlib/readwriter.h"
using namespace std;
int main() {
int seed;
cin >> seed;
registerGen(seed);
int numOfNodes = rnd.next(10, 15);
int numberOfTrees = rnd.next(3, 4);
Graph g = Graph::construct_forest_graph(numOfNodes, numberOfTrees);
g.printTo(cout, Solution);
}
#include "testlib/graph.h"
using namespace std;
int numberOfNodes(vector<vector<int>> graph) {
return (int)graph.size();
}
int main() {
Graph g = Graph::read_graph(cin);
cout << numberOfNodes(g) << '\n';
}