Stress-Testing-bash-script icon indicating copy to clipboard operation
Stress-Testing-bash-script copied to clipboard

How to test for multiple inputs

Open MdNihal05 opened this issue 1 year ago • 4 comments

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 ...

MdNihal05 avatar Nov 28 '23 06:11 MdNihal05

This seems like very specific to a problem. Can you share a sample problem on which you want to stress test?

bhupixb avatar Nov 28 '23 16:11 bhupixb

Problem

https://codeforces.com/contest/1899/problem/G

Submission

https://codeforces.com/contest/1899/submission/233651732

MdNihal05 avatar Nov 28 '23 16:11 MdNihal05

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.

bhupixb avatar Nov 28 '23 17:11 bhupixb

How to check the failed inputs when comparing solution

ghost avatar Nov 30 '23 04:11 ghost