結果

問題 No.583 鉄道同好会
ユーザー tails
提出日時 2017-10-27 23:47:50
言語 Perl
(5.40.0)
結果
AC  
実行時間 749 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-11-21 23:37:37
合計ジャッジ時間 4,629 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

@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