1 minute to teach you how to play the hand-to-beat program

foreword

  As we all know, it is very useful for shooting programs, and can help you judge whether your ugly and long code || is easy to type wrong || correctness is unknown.
  However, when I was doing mock competitions before, I basically didn't play matchmaking, and it all depended on meat checking. (Although I have learned) but in view of the GDOI tomorrow, I will revisit it.
  Disclaimer: This blog is referenced from this blog .

match

  Matching is to help you combine the data generator with two programs, and then judge whether the answers of the two programs are the same.
  First, create a new .txt file and write in it:

:loop
maker.exe
a.exe
b.exe
fc out.txt out.txt
if errorlevel 1 goto end
goto loop
:end

  This is DOS language, and it means something like this:

:loop//循环
maker.exe//运行 数据生成器
a.exe//运行 正确程序
b.exe//运行 待检测程序
fc o1.txt o2.txt//比较 两个程序的输出结果
if errorlevel 1 goto end//如果有错误(两个输出文件不一样)就跳到end
goto loop//跳到loop
:end

  After writing all this, we cruelly changed the suffix .txt of this file to .bat, then clicked on it, and a miracle happened.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325563618&siteId=291194637