結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,184 KB
testcase_01 AC 79 ms
15,200 KB
testcase_02 AC 79 ms
15,168 KB
testcase_03 AC 298 ms
27,372 KB
testcase_04 AC 101 ms
17,100 KB
testcase_05 AC 1,088 ms
58,792 KB
testcase_06 AC 344 ms
29,512 KB
testcase_07 AC 174 ms
21,452 KB
testcase_08 AC 732 ms
44,360 KB
testcase_09 AC 1,781 ms
84,364 KB
testcase_10 AC 2,438 ms
107,024 KB
testcase_11 AC 1,506 ms
73,864 KB
testcase_12 AC 1,048 ms
56,376 KB
testcase_13 AC 229 ms
23,680 KB
testcase_14 AC 2,301 ms
102,500 KB
testcase_15 AC 3,585 ms
146,820 KB
testcase_16 AC 3,099 ms
129,780 KB
testcase_17 AC 3,519 ms
143,500 KB
testcase_18 AC 202 ms
22,672 KB
testcase_19 AC 3,639 ms
149,564 KB
testcase_20 AC 91 ms
15,872 KB
testcase_21 AC 79 ms
15,244 KB
testcase_22 AC 2,377 ms
104,100 KB
testcase_23 AC 3,659 ms
149,444 KB
testcase_24 AC 3,725 ms
149,684 KB
testcase_25 AC 3,609 ms
146,672 KB
testcase_26 AC 78 ms
15,140 KB
testcase_27 AC 261 ms
24,428 KB
testcase_28 AC 2,978 ms
125,584 KB
testcase_29 AC 1,573 ms
75,856 KB
testcase_30 AC 78 ms
15,100 KB
testcase_31 AC 80 ms
15,576 KB
testcase_32 AC 1,332 ms
67,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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