結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 23:17:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 3,673 ms / 5,000 ms
コード長 128 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 11,568 KB
実行使用メモリ 149,712 KB
最終ジャッジ日時 2023-09-14 00:32:10
合計ジャッジ時間 47,628 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,164 KB
testcase_01 AC 76 ms
15,336 KB
testcase_02 AC 76 ms
15,148 KB
testcase_03 AC 291 ms
27,352 KB
testcase_04 AC 102 ms
17,008 KB
testcase_05 AC 1,097 ms
58,940 KB
testcase_06 AC 336 ms
29,444 KB
testcase_07 AC 170 ms
21,264 KB
testcase_08 AC 719 ms
44,460 KB
testcase_09 AC 1,755 ms
84,324 KB
testcase_10 AC 2,458 ms
107,140 KB
testcase_11 AC 1,510 ms
73,940 KB
testcase_12 AC 1,050 ms
56,392 KB
testcase_13 AC 237 ms
23,652 KB
testcase_14 AC 2,330 ms
102,564 KB
testcase_15 AC 3,543 ms
146,688 KB
testcase_16 AC 3,044 ms
129,844 KB
testcase_17 AC 3,390 ms
143,356 KB
testcase_18 AC 198 ms
22,412 KB
testcase_19 AC 3,645 ms
149,712 KB
testcase_20 AC 89 ms
16,060 KB
testcase_21 AC 74 ms
15,164 KB
testcase_22 AC 2,333 ms
103,952 KB
testcase_23 AC 3,596 ms
149,544 KB
testcase_24 AC 3,673 ms
149,416 KB
testcase_25 AC 3,508 ms
146,720 KB
testcase_26 AC 77 ms
15,300 KB
testcase_27 AC 254 ms
24,264 KB
testcase_28 AC 2,976 ms
125,412 KB
testcase_29 AC 1,568 ms
75,720 KB
testcase_30 AC 80 ms
15,156 KB
testcase_31 AC 78 ms
15,432 KB
testcase_32 AC 1,378 ms
67,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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