結果

問題 No.3 ビットすごろく
ユーザー %20%20
提出日時 2017-05-04 01:21:39
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 5,004 KB
最終ジャッジ日時 2023-10-12 08:05:58
合計ジャッジ時間 1,730 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,560 KB
testcase_01 AC 2 ms
4,584 KB
testcase_02 AC 2 ms
4,716 KB
testcase_03 AC 5 ms
4,620 KB
testcase_04 AC 4 ms
4,604 KB
testcase_05 AC 8 ms
4,764 KB
testcase_06 AC 5 ms
4,608 KB
testcase_07 AC 4 ms
4,584 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 8 ms
4,744 KB
testcase_13 AC 5 ms
4,664 KB
testcase_14 AC 11 ms
4,952 KB
testcase_15 AC 14 ms
5,004 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 5 ms
4,468 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,592 KB
testcase_22 AC 11 ms
4,948 KB
testcase_23 AC 13 ms
4,964 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
4,616 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 3 ms
4,528 KB
testcase_32 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
$d[@q=1]=2;
while($i=pop@q){
	$t=0;
	$t+=$i>>$_&1for 0..13;
	if($i-$t>=1){
		$d[$i-$t]||=$d[$i]+!!(push@q,$i-$t)
	}
	if($i+$t<=$N){
		$d[$i+$t]||=$d[$i]+!!(push@q,$i+$t)
	}
}
print$d[$N]-1
0