結果

問題 No.380 悪の台本
ユーザー ldsybldsyb
提出日時 2016-06-18 00:33:49
言語 Ruby
(3.2.2)
結果
AC  
実行時間 283 ms / 1,000 ms
コード長 421 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 20,384 KB
最終ジャッジ日時 2023-08-06 19:47:22
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,284 KB
testcase_01 AC 80 ms
15,268 KB
testcase_02 AC 80 ms
15,156 KB
testcase_03 AC 80 ms
15,028 KB
testcase_04 AC 89 ms
15,296 KB
testcase_05 AC 113 ms
15,272 KB
testcase_06 AC 101 ms
15,380 KB
testcase_07 AC 283 ms
15,472 KB
testcase_08 AC 86 ms
20,384 KB
testcase_09 AC 94 ms
15,348 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