No.700 LOVE
タグ : / 解いたユーザー数 560
作問者 :
はむこ
/ テスター :
Problem Statement
Look at the image below. The first English word you find in it is "what is important to you right now."
TEOWMZGTZKRECDSBYSUY IIXIGGXYZZOUGETSFZNH JELNHDQHYKFIUEQBNQZO PQJXUCRABFHMJUCTASAY FIGZOZABPAQGQZEMDVOG AXSMSWFSPFSUPAVEZWFQ YXXQYDCBYTHBQCNKYSEP ZWLPXHVYFAPDYOVYRZAR SJSLLHVMZCDBYPQXWLYB NPGNDBMWAOPVXIGLPDXRCan LOVE become important?
Input
n m s[1] ... s[n]
$2 \le n \le 50$
$2 \le m \le 50$
$s[i]$ is a string of length $m$ consisting only of uppercase letters.
Output
Strictly speaking, we say that "LOVE can become important" when the consecutive string LOVE appears when reading rightward from some position in the image.
Print YES if LOVE can become important, and NO otherwise.
Print a newline at the end.
Sample
Sample 1
Input
2 6 FJSYSK RLOVER
Output
YES
The string LOVE appears in the second line, so LOVE can become important. Always keep love in your heart.
Sample 2
Input
4 4 LLLL OOOO VVVV EEEE
Output
NO
There is no string that reads LOVE horizontally. You cannot read vertically, diagonally, or leftward.
Sample 3
Input
10 20 TEOWMZGTZKRECDSBYSUY IIXIGGXYZZOUGETSFZNH JELNHDQHYKFIUEQBNQZO PQJXUCRABFHMJUCTASAY FIGZOZABPAQGQZEMDVOG AXSMSWFSPFSUPAVEZWFQ YXXQYDCBYTHBQCNKYSEP ZWLPXHVYFAPDYOVYRZAR SJSLLHVMZCDBYPQXWLYB NPGNDBMWAOPVXIGLPDXR
Output
NO
LOVE could not become important, but FIG at the beginning of the fifth line can become important. Always keep figs in your heart.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。