fix: improved generator
This commit is contained in:
@@ -62,9 +62,26 @@ string rnd_test(int i)
|
||||
|
||||
int n = rnd.next(min_n, max_n);
|
||||
vector<int> nums(n);
|
||||
for (int i = 0; i < n; i++)
|
||||
|
||||
nums[0] = 10;
|
||||
for (int j = 1; j < n; j++)
|
||||
{
|
||||
nums[i] = rnd.next(MIN_NI, MAX_NI);
|
||||
int length = j + 1;
|
||||
|
||||
int choice = rnd.next(0, 100);
|
||||
|
||||
if (choice < 20) {
|
||||
nums[j] = nums[j-1] + rnd.next(1, nums[0] - 1);
|
||||
}
|
||||
else if (choice < 80) {
|
||||
int offset = rnd.next(-2, 3);
|
||||
nums[j] = nums[j-1] + nums[0];
|
||||
}
|
||||
else {
|
||||
nums[j] = nums[j-1] + nums[0] + rnd.next(5, 15);
|
||||
}
|
||||
|
||||
nums[j] = min(nums[j], MAX_NI);
|
||||
}
|
||||
return (output_tc(nums));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user