对拍模板

#include<bits/stdc++.h>
using namespace std;
int main(){
	int T = 1000;
	int timelimit = 1200;
	for(int i = 1; i <= T; ++i){
		system("data.exe > data.in");
		double st = clock();
		system("sol.exe < data.in > data.out");
		double ed = clock();
		system("test.exe < data.in > data.ans");
		if(system("fc data.out data.ans")){
			cout<<i<<": Wrong Answer";
			return 0;
		}
		else if(ed - st >= timelimit){
			cout<<i<<": TLE";
			return 0;
		}
		else{
			printf("%d# Accepted time:%.0lfms\n",i,ed - st);
		}
		//printf("%d# time:%.0lfms\n",i,ed-st);
	}
}

  

posted @ 2020-08-03 13:08  y_dove  阅读(244)  评论(1编辑  收藏  举报