結果

問題 No.3 ビットすごろく
ユーザー mmmpppmmmppp
提出日時 2017-02-27 22:22:24
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,781 ms / 5,000 ms
コード長 183 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 16,048 KB
最終ジャッジ日時 2023-09-14 00:27:42
合計ジャッジ時間 37,538 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,160 KB
testcase_01 AC 81 ms
15,280 KB
testcase_02 AC 78 ms
15,160 KB
testcase_03 AC 246 ms
15,420 KB
testcase_04 AC 96 ms
15,244 KB
testcase_05 AC 835 ms
15,792 KB
testcase_06 AC 272 ms
15,620 KB
testcase_07 AC 142 ms
15,472 KB
testcase_08 AC 550 ms
15,780 KB
testcase_09 AC 1,366 ms
15,732 KB
testcase_10 AC 1,855 ms
15,800 KB
testcase_11 AC 1,164 ms
15,840 KB
testcase_12 AC 813 ms
15,940 KB
testcase_13 AC 194 ms
15,464 KB
testcase_14 AC 1,747 ms
15,760 KB
testcase_15 AC 2,651 ms
16,032 KB
testcase_16 AC 2,306 ms
15,896 KB
testcase_17 AC 2,587 ms
15,976 KB
testcase_18 AC 162 ms
15,352 KB
testcase_19 AC 2,781 ms
16,008 KB
testcase_20 AC 88 ms
15,012 KB
testcase_21 AC 75 ms
15,320 KB
testcase_22 AC 1,788 ms
15,868 KB
testcase_23 AC 2,693 ms
15,960 KB
testcase_24 AC 2,689 ms
16,044 KB
testcase_25 AC 2,696 ms
16,048 KB
testcase_26 AC 76 ms
15,272 KB
testcase_27 AC 214 ms
15,516 KB
testcase_28 AC 2,232 ms
15,752 KB
testcase_29 AC 1,175 ms
15,868 KB
testcase_30 AC 76 ms
15,324 KB
testcase_31 AC 79 ms
15,148 KB
testcase_32 AC 1,028 ms
15,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

r=[-1]*n=gets.to_i+1
r[0]=0
a=(0..n).map{|i|('%b'%i).count ?1}
a[0]=1
n.times{|i|r&[i]==[i]&&n.times{|j|r[j]==i&&(x=j-a[j];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