Files

Tester.jar
MessageDispatcherVis.java
example0.tgz

examples.tgz

Instructions

To use the tester for checking the correctness of your return offline, you'll have to adopt your solution to read the parameters from standard in and write the output to standard out. This doesn't affect the functioning of the solution you submit to our server. You will also have to download and extract the problems from the TGZ files above.

Your program should read N, the number of elements in x and the N elements of x (each element in a separate line). After this, you should output the number of elements in your return M and M lines containing the elements of your return and flush standard out.

To do this, you should implement the following pseudocode:
    N = int(readLine())
    for (i=0; i<N; i++)
        x[i] = int(readLine())
    ret = getEvent(x)
    printLine(ret.length)
    for (i=0; i<ret.length; i++)
        printLine(ret[i])
    flush(stdout)
To run the tester with your solution on a test case <seed>, download or create files questions<seed>.txt and answers<seed>.txt and place them in the same directory as the tester. Then you should run:
java -Xmx2048M -jar Tester.jar -exec "<command>" -seed <seed>
Note that the seed is the example number, plus 1. So example 0 is seed 1. Here, <command> is the command to execute your program. Finally, you can print any debug information of your solution to standard error, and it will be forwarded to the standard out of the tester.

Note that this tool does not provide timing for your program. You should do this on your own, and print your runtimes to standard error.