偶然学到了对拍的正确打开方式。

当然不只限于对拍,也可以偷懒用来测试样例。


首先应该写一个对拍程序:

for(int i=1;i<=300;i++){
	system("数据生成.exe > data.txt");
	system("正解.exe < data.txt > ans.txt");
	system("你的程序.exe < data.txt > out.txt");
	if(system("fc ans.txt out.txt")) return 0;
}

然后将你的程序、对拍程序、正解、数据生成程序放到同一个文件夹里,注意一定要都编译一遍产生一个exe文件。

最后结果也很清晰明了:
对拍技巧

相关文章:

  • 2021-07-15
  • 2021-12-12
  • 2021-12-27
  • 2021-08-31
  • 2021-10-02
  • 2021-11-08
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2021-09-12
  • 2022-12-23
  • 2021-11-20
  • 2021-11-14
相关资源
相似解决方案