結果

問題 No.380 悪の台本
ユーザー ldsybldsyb
提出日時 2016-06-18 00:33:49
言語 Ruby
(3.3.0)
結果
AC  
実行時間 281 ms / 1,000 ms
コード長 421 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 19,456 KB
最終ジャッジ日時 2024-04-24 14:28:01
合計ジャッジ時間 1,778 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

regexps = [
	/^digi .*nyo[^a-zA-Z0-9]{0,3}$/,
	/^petit .*nyu[^a-zA-Z0-9]{0,3}$/,
	/^rabi .*[a-zA-Z0-9].*$/,
	/^gema .*gema[^a-zA-Z0-9]{0,3}$/,
	/^piyo .*pyo[^a-zA-Z0-9]{0,3}$/]

while s = gets
	if !["digi","petit","rabi","gema","piyo"].include?(s.split[0])
		puts "WRONG!"
		next
	end
	s.downcase!
	count = 0
	regexps.each do |regexp|
		count += 1 if s =~ regexp
	end
	puts (count == 1 ? "CORRECT (maybe)" : "WRONG!")
end
0