mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-10 20:18:47 +00:00
53 lines
1.2 KiB (Stored with Git LFS)
C++
53 lines
1.2 KiB (Stored with Git LFS)
C++
// Generator by Baoshuo <i@baoshuo.ren>
|
|
|
|
#include <iostream>
|
|
#include <fstream>
|
|
|
|
#include "testlib.h"
|
|
|
|
using namespace std;
|
|
|
|
int main(int argc, char* argv[]) {
|
|
registerGen(argc, argv, 1);
|
|
|
|
for (int i = 1; i <= 50; i++) {
|
|
std::ofstream cout("data" + std::to_string(i) + ".in");
|
|
|
|
int n, m;
|
|
|
|
if (i <= 15) { // 30%
|
|
n = rnd.next(1, 8);
|
|
m = rnd.next(1, 10);
|
|
} else if (i <= 35) { // 70%
|
|
n = rnd.next(1, 1000);
|
|
m = rnd.next(1, 10000);
|
|
} else { // 100%
|
|
n = rnd.next(1, 100000);
|
|
m = rnd.next(1, 100000);
|
|
}
|
|
|
|
cout << n << ' ' << m << endl;
|
|
|
|
for (int i = 1; i <= n; i++) {
|
|
cout << rnd.next(-10000, 10000) << " \n"[i == n];
|
|
}
|
|
|
|
for (int i = 1; i <= m; i++) {
|
|
int op = rnd.next(1, 2);
|
|
int x = rnd.next(1, n);
|
|
int y = rnd.next(x, n);
|
|
|
|
cout << op << ' ' << x << ' ' << y;
|
|
if (op == 1) {
|
|
int k = rnd.next(-10000, 10000);
|
|
|
|
cout << ' ' << k << endl;
|
|
} else { // op == 2
|
|
cout << endl;
|
|
}
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|