結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,136 KB
testcase_01 AC 75 ms
15,084 KB
testcase_02 AC 77 ms
15,060 KB
testcase_03 AC 232 ms
15,380 KB
testcase_04 AC 87 ms
15,124 KB
testcase_05 AC 851 ms
15,648 KB
testcase_06 AC 263 ms
15,576 KB
testcase_07 AC 138 ms
15,324 KB
testcase_08 AC 559 ms
15,772 KB
testcase_09 AC 1,424 ms
15,896 KB
testcase_10 AC 1,935 ms
15,940 KB
testcase_11 AC 1,191 ms
15,776 KB
testcase_12 AC 818 ms
15,752 KB
testcase_13 AC 192 ms
15,588 KB
testcase_14 AC 1,801 ms
15,776 KB
testcase_15 AC 2,753 ms
15,788 KB
testcase_16 AC 2,345 ms
15,740 KB
testcase_17 AC 2,702 ms
15,756 KB
testcase_18 AC 160 ms
15,368 KB
testcase_19 AC 2,794 ms
15,796 KB
testcase_20 AC 82 ms
15,156 KB
testcase_21 AC 74 ms
15,084 KB
testcase_22 AC 1,878 ms
15,796 KB
testcase_23 AC 2,827 ms
15,700 KB
testcase_24 AC 2,822 ms
15,696 KB
testcase_25 AC 2,821 ms
15,756 KB
testcase_26 AC 82 ms
15,080 KB
testcase_27 AC 219 ms
15,392 KB
testcase_28 AC 2,328 ms
15,788 KB
testcase_29 AC 1,225 ms
15,752 KB
testcase_30 AC 81 ms
15,256 KB
testcase_31 AC 80 ms
15,300 KB
testcase_32 AC 1,082 ms
15,752 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