Visualizer for IOI2007/day1/flood

Here’s another visualizer for an IOI problem, flood this time. It’s a bit more complex than the others, since I had quite a hard time debugging this problem ;) Requires GD.

Source, Makefile, screenshot:

And now the #1 reason I like Linux: here’s an entire checker / evaluator for this problem, in a single line of commands for bash. It took no more than 2 minutes to get together.

for i in tests/*; do echo ––––––––––––––––––––––––––––––––––––––––– && SUFFIX=${i:15} && rm out && time ./flood.e <tests/$SUFFIX >out && cp tests/flood.out.$SUFFIX correct && rm correct_ && sort correct > correct_ && rm out_ && sort out > out_ && ll *_ && diff –q out_ correct_ || break; done

Comments are closed.

%d bloggers like this: