結果

問題 No.326 あみだますたー
ユーザー tailstails
提出日時 2015-12-19 00:56:18
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 5,280 KB
最終ジャッジ日時 2023-10-14 14:10:22
合計ジャッジ時間 4,394 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,680 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,516 KB
testcase_06 AC 8 ms
4,632 KB
testcase_07 AC 4 ms
4,716 KB
testcase_08 AC 43 ms
5,084 KB
testcase_09 AC 41 ms
5,068 KB
testcase_10 AC 46 ms
5,280 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 5 ms
4,740 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,716 KB
testcase_21 AC 3 ms
4,648 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
$k=<>;
@b=0..$n;
$x=<>,$t=$b[$x],$b[$x]=$b[$x+1],$b[$x+1]=$t for 1..$k;
$c[$b[$_]]=$_ for 1..$n;
@a=(0,<>=~/\d+/g);

for$i(1..$n){
	while($a[$i]<$c[$i]){
		push@y,($c[$i]-1).$".$c[$i].$/;
		$_==$c[$i]-1&&++$_ for@c;
		--$c[$i];
	}
	while($a[$i]>$c[$i]){
		push@y,$c[$i].$".($c[$i]+1).$/;
		$_==$c[$i]+1&&--$_ for@c;
		++$c[$i];
	}
}

print@y.$/,@y;
0