Palindromic Paths (Bronze)
의견: 0
Farmer John's farm is an N x N grid of fields (2 <= N <= 18), each labeled with a letter A..Z.
Each day, Bessie walks from the upper-left field to the lower-right field, each step taking her either one field to the right or one field downward. She keeps track of the string she generates from the letters she walks across, and gets disoriented if this string is a palindrome.
Please help Bessie determine the number of different palindromes she can form. Different ways of forming the same palindrome only count once.
Line 1: N. The remaining N lines contain the N rows of the grid; each row contains N characters in the range A..Z.
The number of distinct palindromes Bessie can form.
palpath.inpalpath.out4
ABCD
BXZX
CDXB
WCBA4Output details: The four distinct palindromes are ABCDCBA, ABCWCBA, ABXZXBA, ABXDXBA.
riseoj 작성
출처 올림피아드 > USACO > 2014-2015 > US Open > Bronze
평가 및 의견
Palindromic Paths (Bronze)
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Palindromic Paths (Bronze)