Files

Usage

To use the visualizer for testing your solution locally, 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.

Your program should read the parameters from standard in and write the output to standard out. Assuming that nextInt() is a function that reads the next integer from standard in, you should implement the following pseudocode for interfacing with the visualizer (don't forget to flush standard out!):
    H = nextInt();
    W = nextInt();
    X = nextInt();
    for(i = 0; i<X; i++)
      bookHeights[i] = nextInt();
    for(i = 0; i<X; i++)
      bookWidths[i] = nextInt();
    for(i = 0; i<X; i++)
      bookValues[i] = nextInt();
    ret = arrange(H, W, bookHeights, bookWidths, bookValues);
    for(int i = 0; i<X; i++)
      println(ret[i]);
    flush(stdout)
To run the visualizer with your solution, you should run:
java -jar BookSelectionVis.jar -exec "<command>" -seed <seed>
A note for Java users: if your solution is implemented in file YourSol.java, you need to compile it to YourSol.class file and use
java -jar BookSelectionVis.jar -exec "java YourSol" -seed <seed>
Additionally you can use the following options: Finally, you can print any debug information of your solution to standard error, and it will be forwarded to the standard out of the visualizer.