結果

問題 No.380 悪の台本
ユーザー torus711
提出日時 2016-06-17 23:18:50
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 445 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,584 KB
最終ジャッジ日時 2024-11-06 22:41:17
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 WA * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 .*igema[^a-zA-Z0-9]{0,3}$/,
	/^piyo .*pyo[^a-zA-Z0-9]{0,3}$/ ]

while s = gets
	s.strip!

	if ![ "digi", "petit", "rabi", "gema", "piyo" ].include?( s.split[0] )
		puts "WRONG!"
		next
	end

	s.downcase!

	cnt = 0
	regexps.each do |reg|
		if s =~ reg
			cnt += 1
		end
	end

	puts ( cnt == 1 ? "CORRECT (maybe)" : "WRONG!" )
end
0