結果

問題 No.380 悪の台本
ユーザー char134217728char134217728
提出日時 2017-09-05 22:12:38
言語 Ruby
(3.3.0)
結果
AC  
実行時間 182 ms / 1,000 ms
コード長 414 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-24 14:56:52
合計ジャッジ時間 1,654 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,288 KB
testcase_01 AC 88 ms
12,160 KB
testcase_02 AC 84 ms
12,032 KB
testcase_03 AC 83 ms
12,160 KB
testcase_04 AC 92 ms
12,416 KB
testcase_05 AC 112 ms
12,416 KB
testcase_06 AC 105 ms
12,288 KB
testcase_07 AC 182 ms
12,160 KB
testcase_08 AC 78 ms
12,032 KB
testcase_09 AC 91 ms
12,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

@h = {
  "digi" => /nyo[^a-zA-Z0-9]{0,3}$/i,
  "petit"=> /nyu[^a-zA-Z0-9]{0,3}\z/i,
  "rabi" => /[a-zA-Z0-9]/,
  "gema" => /gema[^a-zA-Z0-9]{0,3}\z/i,
  "piyo" => /pyo[^a-zA-Z0-9]{0,3}\z/i
}
s = nil
def ok(s)
  return false if s.length < 1 || s[0] == " "
  a = s.split(" ")
  @h[a[0]] && a.length > 1 && a[1..-1].join(" ").match(@h[a[0]])
end
while s = gets do
  puts ok(s.chomp) ? "CORRECT (maybe)" : "WRONG!"
end
0