Downloads:
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 first read the number of dynamite types D,
followed by D elements of dynamite and 25*D elements of effect.
Next go the width of the mine W and the number of elements in gold W*H, followed by
W*H elements of gold and W*H elements of rock, and finally by maxMoves.
After reading these variables output your return from collectGold.
Remember to flush standard output after writing to it.
To do this, you should implement the following pseudocode:
D = int(readLine())
for (i=0; i<D; i++)
dynamite[i] = int(readLine())
for (i=0; i<25*D; i++)
effect[i] = int(readLine())
W = int(readLine())
H = int(readLine())/W
for (i=0; i<W*H; i++)
gold[i] = int(readLine())
for (i=0; i<W*H; i++)
rock[i] = int(readLine())
maxMoves = int(readLine())
printLine(collectGold(dynamite, effect, W, gold, rock, maxMoves))
flush(stdout)
To run the visualizer with your solution, you should run:
java -jar Visualizer.jar -exec "<command>" -seed <seed>
Here, <command> is the command to execute your program,
and <seed> is seed for test case generation.
Additionally you can use the following options:
-
-novis to turn off the visualization (by default it is turned on).
-
-delay <ms> to set the delay between visualizing iterations, in milliseconds.
-
-size <S> to set the size of mine cell to S pixels.
-
-fontsize <S> to set the size of font used to depict mine cells to S pixels.
-
if you don't define the executable to run with your solution, you will solve the problem in manual mode.
There are two sets of controls - keyboard and mouse. To move to adjacent cell, mouse-click on it or press
corresponding arrow key. To pass the move ('-'), mouse-click on the current cell or press Space. To set a
dynamite cartridge, mouse-click on the grid showing the effect of the corresponding type of dynamite or
press numeric key of the type. To stop simulation, mouse-click outside of the grids or press Esc.
Note that the visualizer only displays the outcomes for valid moves. Once your program (or you, when playing
in manual mode) attempts to make an invalid move, the simulation will be stopped, no outcome will be displayed
and the error message will be printed to visualizer's console instead.
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.
For more information on using visualizer see http://forums.topcoder.com/?module=Thread&threadID=670892.
Note that this is not troubleshooting thread; please use match forum for questions.