結果

問題 No.483 マッチ並べ
ユーザー tailstails
提出日時 2017-02-10 23:04:56
言語 Perl
(5.38.2)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 526 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 8,784 KB
最終ジャッジ日時 2023-08-28 12:14:53
合計ジャッジ時間 4,227 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
8,540 KB
testcase_01 AC 30 ms
8,552 KB
testcase_02 AC 29 ms
8,468 KB
testcase_03 AC 29 ms
8,592 KB
testcase_04 AC 30 ms
8,604 KB
testcase_05 AC 30 ms
8,716 KB
testcase_06 AC 30 ms
8,564 KB
testcase_07 AC 29 ms
8,588 KB
testcase_08 AC 30 ms
8,536 KB
testcase_09 AC 30 ms
8,596 KB
testcase_10 AC 30 ms
8,564 KB
testcase_11 AC 30 ms
8,448 KB
testcase_12 AC 30 ms
8,448 KB
testcase_13 AC 29 ms
8,588 KB
testcase_14 AC 30 ms
8,532 KB
testcase_15 AC 31 ms
8,664 KB
testcase_16 AC 30 ms
8,660 KB
testcase_17 AC 31 ms
8,480 KB
testcase_18 AC 30 ms
8,708 KB
testcase_19 AC 31 ms
8,600 KB
testcase_20 AC 31 ms
8,452 KB
testcase_21 AC 31 ms
8,480 KB
testcase_22 AC 31 ms
8,556 KB
testcase_23 AC 30 ms
8,532 KB
testcase_24 AC 30 ms
8,556 KB
testcase_25 AC 30 ms
8,748 KB
testcase_26 AC 30 ms
8,620 KB
testcase_27 AC 31 ms
8,784 KB
testcase_28 AC 32 ms
8,484 KB
testcase_29 AC 31 ms
8,644 KB
testcase_30 AC 30 ms
8,528 KB
testcase_31 AC 31 ms
8,624 KB
testcase_32 AC 32 ms
8,540 KB
testcase_33 AC 31 ms
8,564 KB
testcase_34 AC 30 ms
8,432 KB
testcase_35 AC 30 ms
8,556 KB
testcase_36 AC 30 ms
8,564 KB
testcase_37 AC 31 ms
8,516 KB
testcase_38 AC 30 ms
8,608 KB
testcase_39 AC 31 ms
8,476 KB
testcase_40 AC 31 ms
8,528 KB
testcase_41 AC 31 ms
8,760 KB
testcase_42 AC 30 ms
8,472 KB
testcase_43 AC 31 ms
8,748 KB
testcase_44 AC 29 ms
8,456 KB
testcase_45 AC 30 ms
8,428 KB
testcase_46 AC 30 ms
8,604 KB
testcase_47 AC 30 ms
8,780 KB
testcase_48 AC 31 ms
8,484 KB
testcase_49 AC 31 ms
8,528 KB
testcase_50 AC 30 ms
8,512 KB
testcase_51 AC 30 ms
8,520 KB
testcase_52 AC 30 ms
8,480 KB
testcase_53 AC 30 ms
8,740 KB
testcase_54 AC 30 ms
8,648 KB
testcase_55 AC 31 ms
8,684 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::i" used only once: possible typo at Main.pl line 2.
Main.pl syntax OK

ソースコード

diff #

$n=<>;
for$i(1..$n){
	($r1,$c1,$r2,$c2)=glob<>;
	push@{"$r1,$c1"},"$r2,$c2";
	push@{"$r2,$c2"},"$r1,$c1";
	$a{"$r1,$c1,$r2,$c2"}=1;
	$a{"$r2,$c2,$r1,$c1"}=1;
}

sub hoge1 {
	my($yx)=@_;
	@$yx=grep{$a{"$yx,$_"}}@$yx;
	if(@$yx==1){
		$z=pop@$yx;
		$a{"$yx,$z"}=0;
		$a{"$z,$yx"}=0;
		hoge1($z);
	}
}

for$y(1..100){
	for$x(1..100){
		hoge1("$y,$x");
	}
}

sub hoge2 {
	my($yx)=@_;
	if(@$yx>2){
		$f=1;
	}
	my@t=@$yx;
	@$yx=();
	for(@t){
		hoge2($_);
	}
}

for$y(1..100){
	for$x(1..100){
		hoge2("$y,$x");
	}
}

print $f?NO:YES;
0