結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 22:30:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,874 ms / 5,000 ms
コード長 162 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 11,232 KB
実行使用メモリ 15,984 KB
最終ジャッジ日時 2023-09-14 00:29:21
合計ジャッジ時間 38,014 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
15,140 KB
testcase_01 AC 83 ms
15,136 KB
testcase_02 AC 84 ms
15,292 KB
testcase_03 AC 256 ms
15,472 KB
testcase_04 AC 101 ms
15,084 KB
testcase_05 AC 876 ms
15,784 KB
testcase_06 AC 286 ms
15,340 KB
testcase_07 AC 154 ms
15,324 KB
testcase_08 AC 589 ms
15,508 KB
testcase_09 AC 1,412 ms
15,688 KB
testcase_10 AC 1,931 ms
15,780 KB
testcase_11 AC 1,186 ms
15,820 KB
testcase_12 AC 833 ms
15,816 KB
testcase_13 AC 207 ms
15,496 KB
testcase_14 AC 1,806 ms
15,700 KB
testcase_15 AC 2,786 ms
15,720 KB
testcase_16 AC 2,399 ms
15,744 KB
testcase_17 AC 2,684 ms
15,800 KB
testcase_18 AC 171 ms
15,296 KB
testcase_19 AC 2,822 ms
15,916 KB
testcase_20 AC 93 ms
15,260 KB
testcase_21 AC 81 ms
15,236 KB
testcase_22 AC 1,852 ms
15,700 KB
testcase_23 AC 2,874 ms
15,904 KB
testcase_24 AC 2,821 ms
15,852 KB
testcase_25 AC 2,742 ms
15,984 KB
testcase_26 AC 83 ms
15,092 KB
testcase_27 AC 227 ms
15,324 KB
testcase_28 AC 2,339 ms
15,712 KB
testcase_29 AC 1,217 ms
15,816 KB
testcase_30 AC 82 ms
15,260 KB
testcase_31 AC 85 ms
15,072 KB
testcase_32 AC 1,060 ms
15,772 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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