結果

問題 No.380 悪の台本
ユーザー DoG_peerDoG_peer
提出日時 2016-06-17 22:59:51
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 932 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 18,688 KB
最終ジャッジ日時 2024-04-24 14:17:36
合計ジャッジ時間 1,663 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
12,160 KB
testcase_01 RE -
testcase_02 AC 76 ms
12,160 KB
testcase_03 AC 76 ms
12,288 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 75 ms
12,160 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

lines = readlines
def correct
  puts "CORRECT (maybe)"
end

def wrong
  puts "WRONG!"
end

lines.each do |l|
  items = l.split
  name = items[0]
  word = items[1..(-1)].join(" ").downcase
  case name
  when "digi"
    if word =~ /nyo$/
      correct
    elsif word =~ /nyo(.{,3})$/ && $1.gsub("_","") !~ /^\w*$/
      correct
    else
      wrong
    end
  when "petit"
    if word =~ /nyu$/
      correct
    elsif word =~ /nyu(.{,3})$/ && $1.gsub("_","") !~ /^\w*$/
      correct
    else
      wrong
    end
  when "rabi"
    if word =~ /(_|\W)/
      correct
    else
      wrong
    end
  when "gema"
    if word =~ /gema$/
      correct
    elsif word =~ /gema(.{,3})$/ && $1.gsub("_","") !~ /^\w*$/
      correct
    else
      wrong
    end
  when "piyo"
    if word =~ /pyo$/
      correct
    elsif word =~ /pyo(.{,3})$/ && $1.gsub("_","") !~ /^\w*$/
      correct
    else
      wrong
    end

  else
    wrong
  end
end
0