結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 23:03:18
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,865 ms / 5,000 ms
コード長 133 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,532 KB
実行使用メモリ 15,948 KB
最終ジャッジ日時 2023-09-14 00:28:27
合計ジャッジ時間 37,514 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,016 KB
testcase_01 AC 75 ms
15,256 KB
testcase_02 AC 76 ms
15,240 KB
testcase_03 AC 236 ms
15,356 KB
testcase_04 AC 93 ms
15,164 KB
testcase_05 AC 862 ms
15,844 KB
testcase_06 AC 270 ms
15,452 KB
testcase_07 AC 144 ms
15,260 KB
testcase_08 AC 567 ms
15,792 KB
testcase_09 AC 1,383 ms
15,744 KB
testcase_10 AC 1,927 ms
15,740 KB
testcase_11 AC 1,164 ms
15,948 KB
testcase_12 AC 809 ms
15,740 KB
testcase_13 AC 186 ms
15,276 KB
testcase_14 AC 1,830 ms
15,864 KB
testcase_15 AC 2,738 ms
15,740 KB
testcase_16 AC 2,406 ms
15,652 KB
testcase_17 AC 2,749 ms
15,780 KB
testcase_18 AC 163 ms
15,588 KB
testcase_19 AC 2,853 ms
15,768 KB
testcase_20 AC 87 ms
15,016 KB
testcase_21 AC 77 ms
15,128 KB
testcase_22 AC 1,850 ms
15,848 KB
testcase_23 AC 2,865 ms
15,652 KB
testcase_24 AC 2,848 ms
15,736 KB
testcase_25 AC 2,752 ms
15,948 KB
testcase_26 AC 77 ms
15,120 KB
testcase_27 AC 214 ms
15,424 KB
testcase_28 AC 2,279 ms
15,712 KB
testcase_29 AC 1,218 ms
15,692 KB
testcase_30 AC 75 ms
15,164 KB
testcase_31 AC 78 ms
15,352 KB
testcase_32 AC 1,046 ms
15,796 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i+1
r=[0]
n.times{|i|r&[i]==[i]&&n.times{|j|r[j]==i&&(x=j<1?-1:('%b'%j).count(?1)
r[j+x]||=i+1
r[j-x]||=i+1)}}
p r[n-1]||~0
0