Downloads


Helpful information


In order to use the offline tester / visualizer tool 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 parameters: size of the map S, map, W, L and G. To imitate one call of a library function, you should print '?' character followed by the name of the method in the same line, then print the parameters of the method and flush standard out. After each "call" written to standard out, you should read one or two lines representing the return value of the function. Finally, print any non-'?' character (in a separate line) and flush standard out. You don't need to output the return value of your whereAmI method, as it's ignored anyways.

To do this, you should implement the following pseudocode:
    string[] look()
    {   printLine('?look')
        flush(stdout)
        string[] ret(2)
        ret[0] = readLine();
        ret[1] = readLine();
        return ret
    }

    int walk(int[] shift)
    {   printLine('?walk')
        printLine(shift[0])
        printLine(shift[1])
        flush(stdout)
        return int(readLine())
    }

    int guess(int[] coord)
    {   printLine('?guess')
        printLine(coord[0])
        printLine(coord[1])
        flush(stdout)
        return int(readLine())
    }
    
    main()
    {   S = int(readLine())
        for (i=0; i<S; i++)
            map[i] = readLine()
        W = int(readLine())
        L = int(readLine())
        G = int(readLine())
        ret = whereAmI(map, W, L, G)
        printLine('!')
        flush(stdout)
    }

To run the tester with your solution, you should run:
java -jar tester.jar -exec "<command>" -seed <seed>

Here, <command> is the command to execute your program, and <seed> is seed for test case generation. If your compiled solution is an executable file, the command will be the full path to it, for example, "C:\TopCoder\solution.exe" or "~/topcoder/solution". In case your compiled solution is to be run with the help of an interpreter, for example, if you program in Java, the command will be something like "java -cp C:\TopCoder Solution".

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 tester.