結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 22:50:50
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 131 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 11,184 KB
実行使用メモリ 15,940 KB
最終ジャッジ日時 2023-09-02 13:24:53
合計ジャッジ時間 39,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,148 KB
testcase_01 AC 82 ms
15,076 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 101 ms
15,156 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 154 ms
15,272 KB
testcase_08 AC 586 ms
15,820 KB
testcase_09 AC 1,435 ms
15,804 KB
testcase_10 AC 1,961 ms
15,912 KB
testcase_11 AC 1,193 ms
15,620 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2,435 ms
15,644 KB
testcase_17 AC 2,752 ms
15,644 KB
testcase_18 AC 166 ms
15,440 KB
testcase_19 AC 2,892 ms
15,940 KB
testcase_20 AC 93 ms
15,176 KB
testcase_21 AC 81 ms
15,108 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2,924 ms
15,860 KB
testcase_25 AC 2,977 ms
15,728 KB
testcase_26 AC 82 ms
15,104 KB
testcase_27 AC 217 ms
15,316 KB
testcase_28 AC 2,350 ms
15,920 KB
testcase_29 AC 1,242 ms
15,564 KB
testcase_30 AC 82 ms
15,116 KB
testcase_31 AC 82 ms
15,300 KB
testcase_32 AC 1,064 ms
15,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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