1.首先将BL.cpp编写,再将AC.cpp编写出来,前提条件为BL一定是对的
2.将BL与AC的重定向进行更改,将.in指向make.out,将.out更改为文件名+number.out,运行两个程序,产生exe,out
3.编写一个数据生成器.cpp,用时间做种子srand(time(0)),注意随机函数要用<Cstdlib>,时间种子需要<ctime>,运行程序,产生exe,out
4.编写对拍核查程序
5.所有的文件输入输出与文件名必须是英文
以下适合Windows:
标准程序
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<cstdio> #include<iostream> #define FORa(i,s,e) for(i=s;i<=e;i++) #define FORs(i,s,e) for(i=s;i>=e;i--) #define File(name) freopen(name".in","r",stdin); freopen(name".out","w",stdout); using namespace std; static char buf[100000],*pa=buf,*pb=buf; #define gc pa==pb&&(pb=(pa=buf)+fread(buf,1,100000,stdin),pa==pb)?EOF:*pa++ inline int read(); int main() { freopen("make.in","r",stdin); freopen("1.out","w",stdout); int a,b; a=read(),b=read(); cout<<a+b; return 0; } inline int read() { register int x(0);register int f(1);register char c(gc); while(c<'0'||c>'9')f=c=='-'?-1:1,c=gc; while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=gc; return f*x; }
检验程序
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<cstdio> 2 #include<iostream> 3 #define FORa(i,s,e) for(i=s;i<=e;i++) 4 #define FORs(i,s,e) for(i=s;i>=e;i--) 5 #define File(name) freopen(name".in","r",stdin); freopen(name".out","w",stdout); 6 using namespace std; 7 static char buf[100000],*pa=buf,*pb=buf; 8 #define gc pa==pb&&(pb=(pa=buf)+fread(buf,1,100000,stdin),pa==pb)?EOF:*pa++ 9 inline int read(); 10 int main() 11 { 12 freopen("make.in","r",stdin); 13 freopen("2.out","w",stdout); 14 int a,b; 15 a=read(),b=read(); 16 cout<<a+b-1; 17 return 0; 18 } 19 inline int read() 20 { 21 register int x(0);register int f(1);register char c(gc); 22 while(c<'0'||c>'9')f=c=='-'?-1:1,c=gc; 23 while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=gc; 24 return f*x; 25 }
数据生成器
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<ctime> 2 #include<cstdio> 3 #include<cstdlib> 4 #include<iostream> 5 #define FORa(i,s,e) for(i=s;i<=e;i++) 6 #define FORs(i,s,e) for(i=s;i>=e;i--) 7 #define File(name) freopen(name".in","r",stdin); freopen(name".out","w",stdout); 8 using namespace std; 9 static char buf[100000],*pa=buf,*pb=buf; 10 #define gc pa==pb&&(pb=(pa=buf)+fread(buf,1,100000,stdin),pa==pb)?EOF:*pa++ 11 inline int read(); 12 int main() 13 { 14 freopen("make.in","w",stdout);; 15 srand(time(0)); 16 cout<<rand()%100<<" "<<rand()%100; 17 return 0; 18 } 19 inline int read() 20 { 21 register int x(0);register int f(1);register char c(gc); 22 while(c<'0'||c>'9')f=c=='-'?-1:1,c=gc; 23 while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=gc; 24 return f*x; 25 }
对拍程序
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include<cstdio> 2 #include<iostream> 3 #define FORa(i,s,e) for(i=s;i<=e;i++) 4 #define FORs(i,s,e) for(i=s;i>=e;i--) 5 #define File(name) freopen(name".in","r",stdin); freopen(name".out","w",stdout); 6 using namespace std; 7 static char buf[100000],*pa=buf,*pb=buf; 8 #define gc pa==pb&&(pb=(pa=buf)+fread(buf,1,100000,stdin),pa==pb)?EOF:*pa++ 9 inline int read(); 10 int main() 11 { 12 int s=0; 13 while(1) 14 { 15 system("make.exe"); 16 system("1.exe"); 17 system("2.exe"); 18 if(system("fc 1.out 2.out")) 19 system("pause"); 20 else 21 cout<<++s<<endl; 22 } 23 return 0; 24 } 25 inline int read() 26 { 27 register int x(0);register int f(1);register char c(gc); 28 while(c<'0'||c>'9')f=c=='-'?-1:1,c=gc; 29 while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=gc; 30 return f*x; 31 }
感谢各位与信奥一本通的鼎力相助!