結果

問題 No.583 鉄道同好会
ユーザー tailstails
提出日時 2017-10-27 23:47:50
言語 Perl
(5.38.2)
結果
AC  
実行時間 775 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-05-01 18:01:11
合計ジャッジ時間 5,079 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,016 KB
testcase_01 AC 8 ms
6,016 KB
testcase_02 AC 9 ms
5,888 KB
testcase_03 AC 8 ms
5,888 KB
testcase_04 AC 8 ms
6,016 KB
testcase_05 AC 8 ms
6,016 KB
testcase_06 AC 8 ms
5,888 KB
testcase_07 AC 8 ms
5,888 KB
testcase_08 AC 8 ms
5,888 KB
testcase_09 AC 8 ms
5,888 KB
testcase_10 AC 10 ms
6,144 KB
testcase_11 AC 207 ms
17,664 KB
testcase_12 AC 282 ms
21,888 KB
testcase_13 AC 277 ms
22,016 KB
testcase_14 AC 279 ms
21,888 KB
testcase_15 AC 353 ms
26,368 KB
testcase_16 AC 645 ms
44,416 KB
testcase_17 AC 775 ms
52,608 KB
testcase_18 AC 773 ms
52,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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