Stress-Testing-bash-script
Stress-Testing-bash-script copied to clipboard
How to test for multiple inputs
How to stress test if there are multiple inputs like a graph of n nodes a array permutation of n nodes and Binary string of length n Or some strings etc ...
This seems like very specific to a problem. Can you share a sample problem on which you want to stress test?
Problem
https://codeforces.com/contest/1899/problem/G
Submission
https://codeforces.com/contest/1899/submission/233651732
You can do it like:
const int MAX_N = 100;
int n = rand(1, MAX_N);
int q = rand(1, 10);
vector<pair<int, int>> tree = gen_tree(n);
and so on. You can generate a perumatation by taking an array of size n, and shuffling it randomly.
How to check the failed inputs when comparing solution