結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 22:56:49
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,915 ms / 5,000 ms
コード長 135 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,936 KB
最終ジャッジ日時 2023-09-14 00:30:01
合計ジャッジ時間 38,330 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,132 KB
testcase_01 AC 79 ms
15,212 KB
testcase_02 AC 78 ms
15,296 KB
testcase_03 AC 237 ms
15,368 KB
testcase_04 AC 98 ms
15,252 KB
testcase_05 AC 876 ms
15,748 KB
testcase_06 AC 277 ms
15,604 KB
testcase_07 AC 148 ms
15,596 KB
testcase_08 AC 563 ms
15,784 KB
testcase_09 AC 1,437 ms
15,896 KB
testcase_10 AC 1,960 ms
15,748 KB
testcase_11 AC 1,190 ms
15,936 KB
testcase_12 AC 839 ms
15,724 KB
testcase_13 AC 190 ms
15,356 KB
testcase_14 AC 1,883 ms
15,904 KB
testcase_15 AC 2,784 ms
15,936 KB
testcase_16 AC 2,432 ms
15,772 KB
testcase_17 AC 2,681 ms
15,868 KB
testcase_18 AC 162 ms
15,448 KB
testcase_19 AC 2,899 ms
15,788 KB
testcase_20 AC 90 ms
15,300 KB
testcase_21 AC 79 ms
15,148 KB
testcase_22 AC 1,884 ms
15,700 KB
testcase_23 AC 2,877 ms
15,744 KB
testcase_24 AC 2,915 ms
15,936 KB
testcase_25 AC 2,831 ms
15,852 KB
testcase_26 AC 82 ms
15,328 KB
testcase_27 AC 223 ms
15,388 KB
testcase_28 AC 2,348 ms
15,720 KB
testcase_29 AC 1,235 ms
15,780 KB
testcase_30 AC 80 ms
15,352 KB
testcase_31 AC 83 ms
15,228 KB
testcase_32 AC 1,061 ms
15,748 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:j-('%b'%j).count(?1)
r[x]||=i+1
r[j+j-x]||=i+1)}}
p r[n-1]||~0
0