問題一覧 > 通常問題

No.700 LOVE

レベル : / AI推定難易度 : 98 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 560
作問者 : はむこ / テスター : Shohei Fujii
お気に入りにしたユーザー ProblemId : 2301 / 自分の提出
問題文最終更新日: 2026-07-03 11:41:40
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 193 (順位表) の他の問題:

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
NPGNDBMWAOPVXIGLPDXR
Can 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もしくは右上の雲マークをクリックしてアカウントを作成してください。