求助!对拍程序挂了!!
  • 板块灌水区
  • 楼主寄风孤影
  • 当前回复1
  • 已保存回复1
  • 发布时间2022/10/22 20:39
  • 上次更新2023/10/27 06:26:38
查看原帖
求助!对拍程序挂了!!
756684
寄风孤影楼主2022/10/22 20:39

刚学对拍,明明std和test的代码一模一样,怎么老是显示Wrong Answer? 对拍代码:

#include <bits/stdc++.h>
using namespace std;
inline int read(){
	int s = 0 , t = 1;
	char c = getchar();
	while(c < '0' || c > '9'){
		if(c == '-') t = -1;
		c = getchar();
	}
	while(c >= '0' && c <= '9'){
		s = (s << 1) + (s << 3) + (c ^ 48);
		c = getchar();
	}
	return s * t;
}
inline void print(int x){
	if(x <= 9){
		putchar(x + '0');
		return ;
	}
	print(x / 10);
	putchar(x % 10 + '0');
}

int main(){
	for(int i = 1;;i++){
		system("rand.exe > in.txt");
		system("std.exe < in.txt > std.txt");
		system("test.exe <in.txt > test.txt");
		if(system("fc test.txt std.txt")){
			cout << "Wrong Answer";
			return 0;
		}
		else printf("AC #%d\n" , i);
	}
	return 0;
}

2022/10/22 20:39
加载中...