結果

問題 No.583 鉄道同好会
コンテスト
ユーザー 👑 tails
提出日時 2017-10-27 23:47:50
言語 Perl
(5.44.0)
コンパイル:
perl -cw _filename_
実行:
perl -X _filename_
結果
AC  
実行時間 666 ms / 2,000 ms
+ 173µs
コード長 249 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 17 ms
コンパイル使用メモリ 9,680 KB
実行使用メモリ 52,736 KB
最終ジャッジ日時 2026-10-14 18:56:44
合計ジャッジ時間 4,711 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
Useless use of a variable in void context at Main.pl line 12.
Possible precedence problem on bitwise | operator at Main.pl line 14.
Main.pl syntax OK

ソースコード

diff #
raw source code

@n=0..<>;
@s=map[glob],<>;
for(@s){
	$d[$a=$_->[0]]^=1;
	$d[$b=$_->[1]]^=1;
	vec($e[$a],$b,1)=vec($e[$b],$a,1)=1;
	$h|=$e[$a]|$e[$b]
}
sub f{
	my$e=$e[$_];
	$_||${$_=1;vec($e,$_,1)&&f()for@n}for vec$g,$_,1
}
f$_=$a;
print$g ne$h|grep($_,@d)>2?NO:YES
0