結果
問題 | No.700 LOVE |
ユーザー |
![]() |
提出日時 | 2020-11-06 21:59:10 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 118 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-22 23:58:34 |
合計ジャッジ時間 | 2,391 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
コンパイルメッセージ
Syntax OK
ソースコード
class PhraseFinder def initialize(phrase = 'LOVE') @n, _ = gets.split(' ').map(&:to_i) @phrase = phrase @found = false end def find! @n.times do @found = true and break if found? end self end def to_s @found ? 'YES' : 'NO' end private def found? gets.include?(@phrase) end end puts PhraseFinder.new.find!