Moocryption
의견: 0
Farmer John's cows have created a fun "word finder" puzzle. Their only word of interest is "MOO", which can appear in the word finder horizontally, vertically, or diagonally.
The cows have encrypted the puzzle's contents using a "substitution cipher" that replaces each letter of the alphabet with some different letter. No letter maps to itself, and no two letters map to the same letter.
The cows have lost track of the substitution cipher needed to decrypt their puzzle. Please help them determine the maximum possible number of MOOs that could exist in the puzzle for an appropriate choice of substitution cipher.
Line 1: N and M, the number of rows and columns (both at most 50). The next N lines each contain M characters, describing one row of the encrypted puzzle. Each character is an uppercase letter A..Z.
The maximum possible number of MOOs contained in the puzzle if decrypted with an appropriate substitution cipher.
moocrypt.inmoocrypt.out4 6
TAMHGI
MMQVWM
QMMQSM
HBQUMQ6Output details: Replacing "Q" with "M" and "M" with "O" reveals 6 MOOs.
riseoj 작성
출처 올림피아드 > USACO > 2014-2015 > US Open > Bronze
평가 및 의견
Moocryption
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Moocryption