UVa 118

From Algorithmist
Jump to navigation Jump to search

118 - Mutant Flatworld Explorers[edit]

Summary[edit]

Straightforward Simulation problem.

Explanation[edit]

This one is a very trivial simulation problem. Follow all the instructions carefully, and it should be easy. A common mistake is mixing up x and y, and checking the border.

Gotchas[edit]

  • Don't forget "Robot scent". If a robot "lost" in position (x,y), it will left a "scent" there so that if another robot "lost", it won't lost in position (x,y) again. Especially attend to the corners.

Input[edit]

5 3
1 1 E
RFRFRFRF
3 2 N
FRRFLLFFRRFLL
0 3 W
LLFFFLFLFL

Output[edit]

1 1 E
3 3 N LOST
2 3 S

Solution[edit]