結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,036 KB
testcase_01 AC 83 ms
15,096 KB
testcase_02 AC 83 ms
15,248 KB
testcase_03 AC 250 ms
15,380 KB
testcase_04 AC 100 ms
15,156 KB
testcase_05 AC 897 ms
15,604 KB
testcase_06 AC 286 ms
15,504 KB
testcase_07 AC 155 ms
15,560 KB
testcase_08 AC 591 ms
15,880 KB
testcase_09 AC 1,449 ms
15,848 KB
testcase_10 AC 1,999 ms
15,748 KB
testcase_11 AC 1,211 ms
15,780 KB
testcase_12 AC 843 ms
15,808 KB
testcase_13 AC 201 ms
15,384 KB
testcase_14 AC 1,858 ms
15,712 KB
testcase_15 AC 2,853 ms
15,772 KB
testcase_16 AC 2,462 ms
15,948 KB
testcase_17 AC 2,764 ms
15,760 KB
testcase_18 AC 165 ms
15,460 KB
testcase_19 AC 2,977 ms
15,904 KB
testcase_20 AC 90 ms
15,244 KB
testcase_21 AC 80 ms
15,132 KB
testcase_22 AC 1,900 ms
15,676 KB
testcase_23 AC 2,928 ms
15,768 KB
testcase_24 AC 2,916 ms
15,688 KB
testcase_25 AC 2,835 ms
15,776 KB
testcase_26 AC 80 ms
15,152 KB
testcase_27 AC 221 ms
15,372 KB
testcase_28 AC 2,397 ms
15,664 KB
testcase_29 AC 1,250 ms
15,704 KB
testcase_30 AC 85 ms
15,084 KB
testcase_31 AC 89 ms
15,272 KB
testcase_32 AC 1,080 ms
15,664 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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