fix: improved generator

This commit is contained in:
2025-12-19 07:48:56 -03:00
parent d162da22e5
commit 8e50ab4c23
85 changed files with 270 additions and 161 deletions

View File

@@ -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));
}