EscapeTheJail
SRM 356 · 2007-07-02 · by Pawa
Problem Statement
You are given a
Constraints
- jail will contain between 1 and 15 elements, inclusive.
- Each element of jail will contain between 1 and 15 characters, inclusive.
- All elements in jail will contain the same number of characters.
- Each character in each element of jail will be '.', '#', '$' or '@'.
- jail will contain exactly one '@' character.
- jail will contain at least one '$' character.
Statement by TopCoder, Inc. — view the original on the archive.
{"@$"}
Returns: 1.0
You have only one possible move, and it leads you to the exit. So, the answer is 1.
{"$.",
".@"}
Returns: 4.0
{"@..$"}
Returns: 9.0
{"@#",
"#$"}
Returns: -1.0
{"@........$"}
Returns: 81.0
Submissions are judged against all 105 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class EscapeTheJail with a public method double findExit(vector<string> jail) · 105 test cases · 2 s / 256 MB per case