結果

問題 No.380 悪の台本
ユーザー simansiman
提出日時 2022-07-21 13:24:42
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 11,424 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2023-09-15 14:53:54
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,076 KB
testcase_01 WA -
testcase_02 AC 79 ms
15,088 KB
testcase_03 AC 80 ms
15,212 KB
testcase_04 AC 88 ms
15,452 KB
testcase_05 AC 106 ms
15,260 KB
testcase_06 AC 101 ms
15,364 KB
testcase_07 AC 234 ms
15,128 KB
testcase_08 AC 81 ms
15,284 KB
testcase_09 AC 91 ms
15,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def parse(str)
  name, *words = str.split
  words = words.join(' ').downcase

  case name
  when "digi"
    return true if words =~ /nyo[^a-zA-Z0-9]{0,3}$/
  when "petit"
    return true if words =~ /nyu[^a-zA-Z0-9]{0,3}$/
  when "rabi"
    return true if words =~ /[a-zA-Z0-9]/
  when "gema"
    return true if words =~ /gema[^a-zA-Z0-9]{0,3}$/
  when "piyo"
    return true if words =~ /pyo[^a-zA-Z0-9]{0,3}$/
  end

  false
end

while row = gets&.chomp
  if parse(row)
    puts "CORRECT (maybe)"
  else
    puts "WRONG!"
  end
end
0