結果

問題 No.380 悪の台本
コンテスト
ユーザー kotatsugame
提出日時 2019-10-12 17:24:52
言語 Perl
(5.44.0)
コンパイル:
perl -cw _filename_
実行:
perl -X _filename_
結果
AC  
実行時間 66 ms / 1,000 ms
+ 972µs
コード長 424 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 38 ms
コンパイル使用メモリ 9,924 KB
実行使用メモリ 20,608 KB
最終ジャッジ日時 2026-10-01 09:31:06
合計ジャッジ時間 1,569 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "digi" may clash with future reserved word at Main.pl line 7.
Unquoted string "petit" may clash with future reserved word at Main.pl line 10.
Unquoted string "rabi" may clash with future reserved word at Main.pl line 13.
Unquoted string "gema" may clash with future reserved word at Main.pl line 16.
Unquoted string "piyo" may clash with future reserved word at Main.pl line 19.
Main.pl syntax OK

ソースコード

diff #
raw source code

for(<>){
	$ans="CORRECT (maybe)";
	$out="WRONG!";
	s/^\w+ //;
	$a=$&;
	$a=~s/ $//;
	if($a eq digi){
		$ans=$out if!/nyo[^a-zA-Z0-9]{0,3}$/i
	}
	elsif($a eq petit){
		$ans=$out if!/nyu[^a-zA-Z0-9]{0,3}$/i
	}
	elsif($a eq rabi){
		$ans=$out if!/[a-zA-Z0-9]/
	}
	elsif($a eq gema){
		$ans=$out if!/gema[^a-zA-Z0-9]{0,3}$/i
	}
	elsif($a eq piyo){
		$ans=$out if!/pyo[^a-zA-Z0-9]{0,3}$/i
	}
	else{
		$ans=$out
	}
	print$ans,$/
}
0