Crate gcj_helper [] [src]

A helper library for Google Code Jam solutions.

In the Google Code Jam, solving a problem typically requires the following steps:

  1. Open an input file containing a series of test cases.
  2. Open an output file where solutions will be written.
  3. Read the first line from the input file, which consists solely of an unsigned integer specifying the number of test cases in the input file.
  4. For each test case, perform the following steps:
    1. Obtain the corresponding test data by reading one or more lines from the input file (it may be a fixed number, or specified within the test data itself).
    2. Perform some logic using the test data, in order to obtain a set of results.
    3. Write the string "Case #N:" (where N is the number of completed test cases) followed by the results obtained in the previous step, formatted as the problem requires.

Writing code to handle all of the above is tedious and time-consuming, in a situation where every microsecond counts. gcj-helper is designed to handle the boilerplate, so you can focus on writing solutions instead.

Structs

IoHelper

Provides I/O support for problem solving code.

TestEngine

Facilitates the execution of problem solving code.