数据生成器

SP1043 GSS1 - Can you answer these queries I

生成出的一组数据 ```cpp 25 -18 76 -70 -29 -81 70 28 96 68 85 83 17 86 -20 -13 -52 -46 81 43 81 79 79 45 -46 -43 24 14 22 7 8 12 16 18 22 5 6 10 16 13 25 3 18 17 23 22 23 17 21 1 8 16 19 6 25 20 25 19 23 3 3 1 3 9 25 3 7 10 13 3 11 4 20 6 18 ```
by 蒻蒟IOOI蒟蒻 @ 2022-02-11 11:57:35


这个生成的区间会比较靠右吧 [https://oi-wiki.org/contest/problemsetting/#_18](https://oi-wiki.org/contest/problemsetting/#_18)
by BootsH @ 2022-02-11 12:16:36


@[developer6hyx](/user/317805) 谢谢提醒,已经更改了: ```cpp #include <iostream> #include <cstdio> #include <cstdlib> #include <ctime> using namespace std; int rd(int x) { return rand() % (x - 1) + 1; } int rd(int l, int r) { return rand() % (r - l + 1) + l; } int n, m; int main() { srand(time(NULL)); n = rd(30); printf("%d\n", n); for (int i = 1; i <= n; i++) { printf("%d ", rd(-100, 100)); } m = rd(30); printf("\n%d\n", m); for (int i = 1, l, r; i <= m; i++) { l = rd(n), r = rd(n); if (r < l) swap(l, r); printf("%d %d\n", l, r); } return 0; } ```
by 蒻蒟IOOI蒟蒻 @ 2022-02-12 18:26:06


|