Downloads


Here are the steps to make the tester work:

  1. Download the genotype data. Extract the files data_1624x100K.txt and data_1624x100K_annotation.txt. These files are used for test case generation.
  2. Download the reference solution and compile it. The resulted executable will be used to produce the correct answers for each test case. If you remove the main method from the reference solution, the resulted code can be directly submitted to the marathon match. It will compile and run properly. However, since it is very slow, it won't score much (if something at all).
  3. Modify your own solution by adding a "main" method that interacts with the tester. This is described in details below. If you use C++, you can check the "main" method of the reference solution for an example of such modification.
  4. Download the executable JAR of the offline tester. Run it with your solution as described below.

Now let's check steps 3 and 4 in more details.

In order to use the offline tester for testing your solution locally, you'll have to modify your solution by adding the "main" method that interacts with the tester via reading data from standard input and writing data to standard output. As long as you do not change the implementation of the method computeAssociations, this doesn't affect the way your solution works when being submitted to our server.

To simulate a single test case, you should implement the following pseudocode in the main method of your solution:

    N = parseInt(readToken())
    P = parseInt(readToken())
    for (i = 0; i < N; ++ i)
        phenotypes[i] = readLine()

    N = parseInt(readToken())
    M = parseInt(readToken())
    for (i = 0; i < N; ++ i)
        genotypes[i] = readLine()
	
    N = parseInt(readToken())
    C = parseInt(readToken())
    for (i = 0; i < N; ++ i)
        for (j = 0; j < C; ++ j)
            covariates[i * C + j] = parseDouble(readToken())

    result = computeAssociations(phenotypes, genotypes, covariates)

    for (i = 0; i < M * P; ++ i)
        printLine(result[i])

    flush(stdout)

Some conventions used in the pseudocode:

The "main" method of the reference solution is a valid implementation of this protocol.

In order to run the tester, you should use the following command:

java -jar tester.jar -exec "<command_yours>" -refer "<command_refer>" -genotype "data_1624x100K.txt" -genotypeAux "data_1624x100K_annotation.txt"

<command_yours> is the command you would use to execute your solution. If your compiled solution is an executable file, the command will just be the full path to it, for example, "C:\TopCoder\solution.exe" or "~/topcoder/solution". In a similar way, "<command_refer>" is the command to execute the reference solution. "data_1624x100K.txt" and "data_1624x100K_annotation.txt" are two genotype data files that you can download above. All test data in this problem (including example, provisional and system tests) is generated using these files. For testing/debugging purposes, you can also design your own versions of these files. As long as you keep the same format, it is possible to pass these files to the tester instead of the supplied ones.

Additionally you can use the following parameters (all are optional):

This local tester will run both your solution and the reference one. After that it will calculate the raw score of your solution. When your solution exceeds the time limit, the raw score will be 0. Note that execution time computed by the offline tester includes the time consumed by I/O interaction between your solution and the tester. Thus, the real execution time of your solution is somewhat smaller than the time reported by the tester.

After you run the tester with some seed <S>, it will cache the reference answer into a file called "seed<S>.ans". If you run subsequent tests with the same seed, the tester will read the answer from this file instead of executing the reference solution once again. This allows to speed up the process if you are running many tests with the same seeds. However, you need to be accurate with this when using -sampleRows and -sampleCols options. Tests with the same seed and different values of sampleRows/sampleCols are different, but the tester won't recognize that. It is most safe to delete "seed<S>.ans" files if you are actively using -sampleRows and -sampleCols options. This will force the tester to run the reference solution once again instead of reusing the existing (wrong) answer.

Finally, here is one option that you may find useful for debugging. In your solution, you can print any debug information to the standard error stream. When your solution is run with the offline tester, all this information will be forwarded to the standard output stream of the tester and thus you will see it. Note that should not write any debug information to the standard output stream as it is reserved for interaction with the tester.