結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,176 KB
testcase_01 AC 78 ms
15,012 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 95 ms
15,096 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 148 ms
15,256 KB
testcase_08 AC 577 ms
15,660 KB
testcase_09 AC 1,427 ms
15,876 KB
testcase_10 AC 1,969 ms
15,876 KB
testcase_11 AC 1,213 ms
15,632 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2,458 ms
15,604 KB
testcase_17 AC 2,765 ms
15,696 KB
testcase_18 AC 165 ms
15,484 KB
testcase_19 AC 2,910 ms
15,704 KB
testcase_20 AC 87 ms
15,096 KB
testcase_21 AC 78 ms
15,144 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 2,909 ms
15,700 KB
testcase_25 AC 2,862 ms
15,720 KB
testcase_26 AC 79 ms
15,016 KB
testcase_27 AC 216 ms
15,516 KB
testcase_28 AC 2,370 ms
15,752 KB
testcase_29 AC 1,249 ms
15,676 KB
testcase_30 AC 79 ms
15,256 KB
testcase_31 AC 80 ms
15,016 KB
testcase_32 AC 1,074 ms
15,840 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