Files
Usage
To use this tool, you should modify your code to read input from standard in
and write output to standard out. Note that this does not affect the code you
submit to TopCoder for scoring -- you should only do this for offline testing.
To interface with the pool, your program should read the inputs in the order
they appear. When reading the positions input, you will simply read
M*(N+1)*N*2 doubles. You should then compute your output and write the M*N
elements to standard out. For example, you might add the following main
method to your code:
int main(){
MaintainPlanes mp;
int M, N;
double home_lat, home_lng, d;
vector<double> positions;
scanf("%d%d%lf%lf",&M,&N,&home_lat,&home_lng);
for(int i = 0; i<M*(N+1)*N*2; i++){
scanf("%lf",&d);
positions.push_back(d);
}
vector<int> r = mp.schedule(M,N,home_lat,home_lng,positions);
for(int i = 0; i<M*N; i++)
printf("%d\n",r[i]);
fflush(stdout);
}
To run the tool on the command line, execute
java -jar Tester.jar
<args>
<args> may include the following
- -exec CMD -- This gives the command to your compiled executable, and is
required
- -seed S -- This controls the seed to the random number generator which
creates the test cases
- -vis OUT -- This allows you to visualize your test case, not just run
it. If OUT is simple a dash, -, then the image is shown on your screen,
otherwise it is saved in a file "OUT.png".
- -C S -- This controls the size of the output image. The image will be
360*S+1 x 180*S+1 pixels.
- -noproj -- turns off the default
projection, and use the mercator
projection.
Note that, in the visualization, the lines shown are the great circle paths, and will not appear as straight lines.
Finally, since your output will be sent to standard out, you may not use that
for debugging purposes. Instead, you should print any debugging messages to
standard error. These will be forwarded to the console.