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.
The visualizer uses pre-generated images of letters.
Therefore, in order for it to work properly, make sure that you download our set of images and put it in directory
called "letters" located in the directory from which you run the visualizer.
Your program should first read the parameters H, W, nb and nLetter.
To imitate one call of ImageToScan.scan, you should print '?' character (in a separate line, quotes for clarity only),
then print row parameter and flush standard out.
After each "call" written to standard out, you should read one line representing the return of the function.
Finally, print any non-'?' character (in a separate line) and H lines containing
the elements of your return (each one in a separate line) and flush standard out.
To do this, you should implement the following pseudocode:
string scan(row)
{ printLine('?')
printLine(row)
flush(stdout)
return readLine()
}
main()
{ H = int(readLine())
W = int(readLine())
nb = int(readLine())
nLetter = int(readLine())
ret = restore(H,W,nb,nLetter)
printLine('!')
for (i=0; i<H; i++)
printLine(ret[i])
flush(stdout)
}
To run the visualizer with your solution, you should run:
java -jar ImageScannerVis.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.
-
-delay <ms> to set the delay between visualizing scans, in milliseconds.
-
-manual to solve the problem by hand. In manual mode you can left-click on any pixel of the image to change your guess for it, left-click outside of the image
to scan the row in which you clicked, or right-click anywhere to submit your guess. You won't be able to change the guesses for pixels in scanned
rows, or to scan the same row twice.
-
-size to set the size of "pixel" in visualization.
-
-hint to see the actual image as a hint.
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 the following
thread.
Note that this is not a troubleshooting thread; please use the match forum for questions.