ZOJ Problem Set - 2125
Input contains multiple test cases. Each test case starts with a number X (1 <= X <= 9), which specifies the position of the match you can fire. Then followed by 9 lines, each line consists of 6 characters. The characters may be '.', '-', 'L', 'T' or '+', which specify an empty block or a corresponding type of fuse block.
There is one line for each test case, which is the maximum number of rockets you can make launch by firing the match on the X'th row. If no rockets can launch, just output 0.
1 LLLLLL LLLLLL LLLLLL LLLLLL LLLLLL LLLLLL LLLLLL LLLLLL LLLLLL 3 ...... .L---- -+---- .-.... .T---L .L---- ...... ...... ...... 5 -L-L-L -TL--T -L-T-L --+--- ---T-- -TL--- ---LT- ---T-T -TL-T- 1 TTTTTT TTTTTT TTTTTT TTTTTT TTTTTT TTTTTT TTTTTT TTTTTT TTTTTT
1 3 4 9
The time limit has been set to 3 times of the time the standard solution requires.
Where is my soul floating? Where is the end? Before the finality of sinking into the sea of chaos, what shall I adhere to to continue this journey? Aimlessly roving in this lonesome and listless world, I wish the power of changing the world. I pour the whole of my volition, agglomerating into a ghost of a power with a light light light of hope, which has been all my power and established Fairyair -- http://fairyair.yeah.net/
Author: CHEN, Shixi
Source: Online Contest of Fantastic Game