ACM Procedures for the Racket procedure show

Source: Internet
Author: User

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.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.