When playing the ACM game, if a program really doesn't know what's wrong, and the rest of the time is quite sufficient, to Pat is a very good means, to clap the meaning is that the current one of your program to find the answer is wrong, but do not know the wrong, the conditions allow, you can write another search procedures to come to the answer, Match your output with WA, and see what's wrong. You can also find out the difference between your WA program and your AC program in peacetime training. Here's how to use the racquet.
Additional: In fact, before the start of the game can be taken to the three words to write well, and three txt built, the game is really to use to shoot on the program written on the Freopen on the line
The first step: Create a new "Duipai" folder in E disk, (in which folder will be new, this does not matter, see personal convenience)
Next I want to generate a test data, on the code (this test data in accordance with the subject of the requirements of their own, may not be made out)
#include <cstdio>
#include <cstring>
#include <ctime>
#include <cstdlib>
int main (void)
{
freopen ("E://duipai//data.txt", "w", stdout);
Srand (Time (NULL));
int n=10000;//n How much oneself
is fixed while (n--)
{
printf ("%d\n", Rand ());
}
return 0;
}
After running this program, a data.txt text document is generated inside the Duipai.
Open Data.txt, there will be a lot of test data,
Next, will use two programs, one is you write the error program, the other is the answer absolutely correct or is the search (TLE), respectively redirects to the Duipai, the error program output is OUT2, the correct program output is OUT1,
of the wrong
The right program
After running the two programs separately, there will be two more txt,out1.txt,out2.txt in the Duipai folder.
Here's the most important step.
Create a TXT
Enter the Duipai.txt inside
After saving, change the suffix of duipai.txt to Duipai.bat
And then run this bat and you can see the gap between the shots.