結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,160 KB
testcase_01 AC 84 ms
15,292 KB
testcase_02 AC 83 ms
15,256 KB
testcase_03 AC 308 ms
27,408 KB
testcase_04 AC 105 ms
17,104 KB
testcase_05 AC 1,137 ms
58,816 KB
testcase_06 AC 350 ms
29,424 KB
testcase_07 AC 175 ms
21,184 KB
testcase_08 AC 736 ms
44,216 KB
testcase_09 AC 1,837 ms
84,216 KB
testcase_10 AC 2,510 ms
107,040 KB
testcase_11 AC 1,570 ms
74,044 KB
testcase_12 AC 1,073 ms
56,572 KB
testcase_13 AC 240 ms
23,468 KB
testcase_14 AC 2,378 ms
102,344 KB
testcase_15 AC 3,653 ms
146,752 KB
testcase_16 AC 3,154 ms
129,836 KB
testcase_17 AC 3,549 ms
143,256 KB
testcase_18 AC 201 ms
22,516 KB
testcase_19 AC 3,735 ms
149,420 KB
testcase_20 AC 96 ms
16,140 KB
testcase_21 AC 82 ms
15,316 KB
testcase_22 AC 2,422 ms
103,924 KB
testcase_23 AC 3,739 ms
149,408 KB
testcase_24 AC 3,727 ms
149,516 KB
testcase_25 AC 3,652 ms
146,720 KB
testcase_26 AC 81 ms
15,120 KB
testcase_27 AC 266 ms
24,280 KB
testcase_28 AC 3,061 ms
125,472 KB
testcase_29 AC 1,613 ms
75,884 KB
testcase_30 AC 83 ms
15,312 KB
testcase_31 AC 86 ms
15,420 KB
testcase_32 AC 1,390 ms
67,972 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=j<1?-1:('%b'%j).count(?1)
r[j+x]||=i+1
r[j-x]||=i+1)}}
p r[k]||~0
0