結果

問題 No.380 悪の台本
ユーザー yuruhiyayuruhiya
提出日時 2020-10-22 16:58:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 461 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 20,140 KB
最終ジャッジ日時 2023-09-28 14:41:15
合計ジャッジ時間 3,020 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,148 KB
testcase_01 WA -
testcase_02 AC 83 ms
15,352 KB
testcase_03 AC 84 ms
15,216 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 392 ms
15,588 KB
testcase_08 AC 88 ms
20,140 KB
testcase_09 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!ruby -n
$_ =~ /(.+?) (.*)/
character, words = $1, $2

answer = { true => 'CORRECT (maybe)', false => 'WRONG!' }
characters = %w[digi petit rabi gema piyo]
suffixes = {
	'digi' => 'nyo', 'petit' => 'nyu', 'gema' => 'gema', 'piyo' => 'pyo'
}
if characters.include?(character)
	if suffixes.key?(character)
		puts answer[words.match?(/.*#{suffixes[character]}[^a-zA-Z0-9]{,3}/i)]
	else
		puts answer[words.match?(/[a-zA-Z0-9]/)]
	end
else
	puts answer[false]
end
0