結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
12,032 KB
testcase_01 RE -
testcase_02 AC 81 ms
12,160 KB
testcase_03 AC 79 ms
12,032 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 AC 85 ms
12,032 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]
  if items.length == 1
    wrong
    next
  end
  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"
    word.gsub!(" ","")
    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