結果

問題 No.700 LOVE
ユーザー Yuki KawabeYuki Kawabe
提出日時 2018-08-24 14:39:28
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 15,296 KB
最終ジャッジ日時 2023-09-03 18:54:55
合計ジャッジ時間 3,918 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 71 ms
15,248 KB
testcase_02 AC 70 ms
15,184 KB
testcase_03 AC 70 ms
15,160 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 70 ms
14,992 KB
testcase_07 AC 69 ms
15,136 KB
testcase_08 WA -
testcase_09 AC 69 ms
15,120 KB
testcase_10 AC 72 ms
15,032 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 70 ms
15,272 KB
testcase_15 AC 69 ms
14,992 KB
testcase_16 AC 70 ms
15,268 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:19: warning: possibly useless use of == in void context
Main.rb:16: warning: possibly useless use of == in void context
Main.rb:13: warning: possibly useless use of == in void context
Syntax OK

ソースコード

diff #

string = readlines

string.each_with_index do |line, index|
  if index + 1 == string.length
    print "NO"
    return
  end
  length = line.length
  length.times do |i|
    current_char = string[length]
    if current_char == "L" && length - i == 5
      length = length + 1
      next_char == string[length]
      if next_char == "O" && length - i == 4
        length = length + 1
        next_char == string[length]
        if next_char == "V" && length - i == 3
          length = length + 1
          next_char == string[length]
          if next_char == "E" && length - i == 2
            print "YES"
            return
          end
        end
      end
    end
  end

end
0