結果

問題 No.380 悪の台本
ユーザー yuruhiyayuruhiya
提出日時 2020-10-22 17:05:06
言語 Ruby
(3.3.0)
結果
AC  
実行時間 394 ms / 1,000 ms
コード長 463 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 20,136 KB
最終ジャッジ日時 2023-09-28 14:42:04
合計ジャッジ時間 2,349 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,292 KB
testcase_01 AC 86 ms
15,156 KB
testcase_02 AC 87 ms
15,364 KB
testcase_03 AC 88 ms
15,128 KB
testcase_04 AC 107 ms
15,232 KB
testcase_05 AC 170 ms
15,664 KB
testcase_06 AC 128 ms
15,288 KB
testcase_07 AC 394 ms
15,504 KB
testcase_08 AC 88 ms
20,136 KB
testcase_09 AC 106 ms
15,472 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!ruby -n
answer = { true => 'CORRECT (maybe)', false => 'WRONG!' }
characters = %w[digi petit rabi gema piyo]
suffixes = {
	'digi' => 'nyo', 'petit' => 'nyu', 'gema' => 'gema', 'piyo' => 'pyo'
}

$_ =~ /(.+?) (.*)/
character, words = $1, $2

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