Sinux's blog

By Sinux, history, 7 months ago, In English

Hi, I was practicing solving problems from USACO and I became curious when I saw the test data. The majority of the test data have surprisingly large numbers of test data. How are these test cases made? Do the problems maker calculate the output with these unusually large numbers of inputs?(Sorry for the bad english)

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
7 months ago, # |
  Vote: I like it +2 Vote: I do not like it

You can refer to Polygon,Testlib's Generator part and Cyaron's wiki for more information.

»
7 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Large test cases near the maximum constraint are necessary to test that the contestants code is fast enough to receive full credit. These test cases generated and are run against the intended solution. When you take the contest, the same test data are ran against your solution and it will be judged correct if it matches the output of the intended solution.

»
7 months ago, # |
  Vote: I like it +1 Vote: I do not like it

These test cases are made with a generator with testlib.h. Or maybe they’re generated by an automatic program that outputs random content to a file. Anyway, it can’t be typed manually.

Also, the corresponding reference output is generated by an automatic program that reads the input and writes the output.

You can use Polygon to do all these works.