#include<ctime>#include<cstdio>#include<random>#include<string>#include<cassert>#include<cstdlib>#include<iostream>#defineintlonglongvoidprint(intx){if(x <0) x =-x,putchar('-');if(x >9)print(x /10);putchar(x %10+'0');}voidprintsp(intx){print(x),putchar('');}voidprintln(intx){print(x),putchar('\n');}char str[]="E .in";constint Buff =3989;
std::string string;namespaceData_Maker{
std::mt19937 rnd(time(0));intrand(intl,intr){int x = r - l +1;return(rnd()% x + x)% x + l;}int a, A, b, B;voidmaker(intsubtaskID){int t = Buff + subtaskID;if(3<= subtaskID && subtaskID <=4)
t -=3000;println(t);if(subtaskID ==2|| subtaskID ==3|| subtaskID ==5){int MOD =0;if(subtaskID ==2) MOD =100;if(subtaskID ==3) MOD =100000;if(subtaskID ==5) MOD =100000000;while(t--){
a =rand(1, MOD), A =rand(1, MOD);
b =rand(1, MOD), B =rand(1, MOD);while(b == a)
b =rand(1, MOD);printsp(a),printsp(A),printsp(b),println(B);}}}voidFile(intTest){
str[1]= Test /10+'0';
str[2]= Test %10+'0';freopen(str,"w", stdout);}voidSubtask2(){for(int Test =1; Test <=1;++Test){File(Test);maker(2);}}voidSubtask3(){for(int Test =2; Test <=2;++Test){File(Test);maker(3);}}voidSubtask5(){for(int Test =3; Test <=3;++Test){File(Test);maker(5);}}}usingnamespace Data_Maker;signedmain(){Subtask2();Subtask3();Subtask5();}
另外还提供了下面的 Special Judge,可以编译并通过调用 spj E.in E.out E.ans 来获取返回信息。
#include"testlib.h"#defineintlonglong#defineinf inf.readLong()#defineouf ouf.readLong()#defineans ans.readLong()boolwin(inta,intA,intb,intB){int x =0, f =1;if(a < b)
a ^= b ^= a ^= b, A ^= B ^= A ^= B, f *=-1;while(1){if(B - a <=0){
x =1;break;}if(A - b <=0){
x =-1;break;}
B -= a, A -= b;}
x *= f;return x <0;}signedmain (signedargc,char**argv){registerTestlibCmd(argc, argv);int q = inf;for(int t =1; t <= q;++t){int a = inf, A = inf, b = inf, B = inf, c = ouf, C = ouf, d = ans, D = ans;if(d ==-1&& c ==-1&& C ==-1)continue;if(c == a)quitf(_wa,"Test #%lld, a cannot equal to c!", t);if(c <1|| C <1)quitf(_wa,"Test #%lld, cannot print negative numbers!", t);if(!win(c, C, a, A))quitf(_wa,"Test #%lld, A cannot beat C!", t);if(!win(b, B, c, C))quitf(_wa,"Test #%lld, C cannot beat B!", t);if(!win(a, A, b, B))quitf(_wa,"Test #%lld, B cannot beat A!", t);}quitf(_ok,"Good job!");}