結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,300 KB
testcase_01 AC 78 ms
15,152 KB
testcase_02 AC 81 ms
15,276 KB
testcase_03 AC 242 ms
15,308 KB
testcase_04 AC 101 ms
15,292 KB
testcase_05 AC 861 ms
15,644 KB
testcase_06 AC 277 ms
15,460 KB
testcase_07 AC 145 ms
15,476 KB
testcase_08 AC 568 ms
15,936 KB
testcase_09 AC 1,388 ms
15,644 KB
testcase_10 AC 1,910 ms
15,736 KB
testcase_11 AC 1,174 ms
15,964 KB
testcase_12 AC 809 ms
15,940 KB
testcase_13 AC 193 ms
15,340 KB
testcase_14 AC 1,831 ms
15,640 KB
testcase_15 AC 2,741 ms
15,732 KB
testcase_16 AC 2,388 ms
15,836 KB
testcase_17 AC 2,685 ms
15,908 KB
testcase_18 AC 168 ms
15,564 KB
testcase_19 AC 2,828 ms
15,944 KB
testcase_20 AC 87 ms
15,156 KB
testcase_21 AC 79 ms
15,140 KB
testcase_22 AC 1,850 ms
15,692 KB
testcase_23 AC 2,840 ms
15,892 KB
testcase_24 AC 2,838 ms
15,888 KB
testcase_25 AC 2,772 ms
15,948 KB
testcase_26 AC 78 ms
15,124 KB
testcase_27 AC 214 ms
15,388 KB
testcase_28 AC 2,304 ms
15,868 KB
testcase_29 AC 1,203 ms
15,804 KB
testcase_30 AC 80 ms
15,280 KB
testcase_31 AC 81 ms
15,148 KB
testcase_32 AC 1,043 ms
15,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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