ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1145. Rope in the Labyrinth

WA1
Posted by Eustas 21 Aug 2008 12:37
Trying to solve this simple problem and always get WA1. Tried to read input by chars/by lines. Tried to output with endline and without...

Got some questions.
What is correct answer for:
3 3
###
#.#
###

...and for:
3 3
###
###
###

...is such input correct:
3 3
#.#
...
#.#

May be i'm on wrong way - my algo is - create a list of leaves of tree; delete them and increment counter; repeat until leaves list is empty. answer is doubled counter - 1 or doubled counter if one vertex left in tree.