結果

問題 No.700 LOVE
ユーザー okuramasafumi
提出日時 2020-11-06 21:34:15
言語 Ruby
(3.4.1)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-07-22 23:58:18
合計ジャッジ時間 2,350 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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
    puts @found ? 'YES' : 'NO'
  end

  private

  def found?
    gets.include?(@phrase)
  end
end

PhraseFinder.new.find!
0