1. 程式人生 > >[競賽]Beat Matching(對拍)

[競賽]Beat Matching(對拍)

ostream cin goto .net ret nbsp cti mes eve

對拍的基本理論這裏恕我不一一敘述,不會的請轉身到這裏:http://blog.csdn.net/code12hour/article/details/51252457

分為以下幾個部分:

1、暴力偽標程(baoli)

 1 #include <iostream>
 2 using namespace std;  
 3 
 4 int main()
 5 { 
 6     int a,b;  
 7     cin >> a >> b; 
 8     cout << a+b << endl; 
 9     return
0; 10 }

2、自己的程序(me)

1 #include <stdio.h>
2 
3 int main() 
4 {
5     int a, b;
6     scanf("%d %d",&a, &b);
7     printf("%d\n", a+b);
8     return 0;
9 }

3、數據生成器(gen)

#include <iostream>   
#include <cstdio>  
#include <cstdlib>  
#include <cstring>  
#include 
<ctime> #include <fstream> #include <algorithm> #include <windows.h> using namespace std; int main() { srand(time(0)); int a,b; a=rand()%100+1,b=rand()%100+1; printf("%d %d\n",a,b); return 0; }

4、對拍

:again  
gen > input.txt  
baoli 
< input.txt > baoli_output.txt me < input.txt > me_output.txt fc baoli_output.txt me_output.txt if not errorlevel 1 goto again pause

[競賽]Beat Matching(對拍)