結果

問題 No.326 あみだますたー
ユーザー %20%20
提出日時 2017-01-07 14:46:14
言語 Perl
(5.38.2)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 569 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 8,552 KB
最終ジャッジ日時 2023-08-22 16:10:40
合計ジャッジ時間 3,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,228 KB
testcase_01 AC 6 ms
5,268 KB
testcase_02 AC 11 ms
5,472 KB
testcase_03 AC 152 ms
8,228 KB
testcase_04 AC 34 ms
6,092 KB
testcase_05 AC 6 ms
5,236 KB
testcase_06 AC 83 ms
6,828 KB
testcase_07 AC 33 ms
5,948 KB
testcase_08 AC 60 ms
7,196 KB
testcase_09 AC 159 ms
8,532 KB
testcase_10 AC 144 ms
8,552 KB
testcase_11 AC 7 ms
5,204 KB
testcase_12 AC 78 ms
6,880 KB
testcase_13 AC 90 ms
7,176 KB
testcase_14 AC 17 ms
5,564 KB
testcase_15 AC 31 ms
6,328 KB
testcase_16 AC 33 ms
7,344 KB
testcase_17 AC 41 ms
6,092 KB
testcase_18 AC 33 ms
6,112 KB
testcase_19 AC 45 ms
6,768 KB
testcase_20 AC 6 ms
5,372 KB
testcase_21 AC 6 ms
5,336 KB
testcase_22 AC 84 ms
6,948 KB
testcase_23 AC 75 ms
6,856 KB
testcase_24 AC 130 ms
7,928 KB
testcase_25 AC 110 ms
7,400 KB
testcase_26 AC 14 ms
5,504 KB
testcase_27 AC 82 ms
6,984 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

<>;<>;
@XY=map[glob],<>;
$a[$_]=++$i for@{pop@XY};

for$i(1..$#a){
	$t=$a[$i];
	$t==@$_[0]?++$t:$t==@$_[1]&&--$t for@XY,@xy;
	if($t<$i){
		push@xy,map[$_,$_+1],$t..$i-1
	}elsif($i<$t){
		push@xy,map[-$_,-$_+1],-$t+1..-$i
	}
}

print@xy.$/,map"@$_\n",@xy
0