简洁版
#include#define Pair pair #define MP(x, y) make_pair(x, y)#define fi first#define se second//#define int long long #define LL long long #define Fin(x) {freopen(#x".in","r",stdin);}#define Fout(x) {freopen(#x".out","w",stdout);}using namespace std;const int MAXN = 1e6 + 10, mod = 1e9 + 7, INF = 1e9 + 10;const double eps = 1e-9;template inline bool chmin(A &a, B b){if(a > b) {a = b; return 1;} return 0;}template inline bool chmax(A &a, B b){if(a < b) {a = b; return 1;} return 0;}template inline LL add(A x, B y) {if(x + y < 0) return x + y + mod; return x + y >= mod ? x + y - mod : x + y;}template inline void add2(A &x, B y) {if(x + y < 0) x = x + y + mod; else x = (x + y >= mod ? x + y - mod : x + y);}template inline LL mul(A x, B y) {return 1ll * x * y % mod;}template inline void mul2(A &x, B y) {x = (1ll * x * y % mod + mod) % mod;}template inline void debug(A a){cout << a << '\n';}template inline LL sqr(A x){return 1ll * x * x;}inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return x * f;}signed main() { return 0;}/*7-1 160 -200014 82 61 85 41 10 34*/
完整版
/**/#include//#include /*#include #include #include #include #include
#include#include #include #include #include using namespace std;#define problem "a" //输出文件名 #define prename "a" //更改之前的文件名 char ak[1000];int cases = 10;//数据组数 int mode = 1;//造数据 / 重新编号 int getrand() { return (rand() << 15) + rand() + 1;}long long getlong() { return ((long long)getrand() << 31) + getrand();}const int MAXN = 1e5 + 10;#define int long long#define ch(x, y) (test >= x && test <= y)void make_data(int test) { int N, K, A, B, Lim; A = getrand() % Lim, B = getrand() % Lim; if(ch(1, 4)) Lim = 1e3; else if(ch(5, 6)) Lim = 1e7; else Lim = 1e13; N = rand() % Lim + 1, K = rand() % Lim + 1; if(test == 4) N = 1e13, K = 1; cout << N << " " << K << " " << A << " " << B;}#undef int main() { //srand(time(0)); for (int a = 1; a <= cases; a++) { fprintf(stderr, "%d\n", a); if (mode == 1) { sprintf(ak, problem "%d.in", a); freopen(ak, "w", stdout); make_data(a); fclose(stdout);#ifdef unix sprintf(ak, "./" problem " < " problem "%d.in > " problem "%d.out", a, a);#else sprintf(ak, problem ".exe < " problem "%d.in > " problem "%d.out", a, a);#endif system(ak); } if (mode == 2) {#ifdef unix sprintf(ak, "mv " prename "%d.in " problem "%d.in", a, a);#else sprintf(ak, "rename " prename "%d.in " problem "%d.in", a, a);#endif system(ak);#ifdef unix sprintf(ak,"mv " prename "%d.out " problem "%d.out", a, a);#else sprintf(ak, "rename " prename "%d.out " problem "%d.out", a, a);#endif system(ak); } } return 0;}