結果

問題 No.162 8020運動
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-03-06 00:19:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-08-26 23:14:02
合計ジャッジ時間 4,663 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,108 KB
testcase_01 AC 85 ms
15,160 KB
testcase_02 AC 88 ms
15,096 KB
testcase_03 AC 94 ms
15,360 KB
testcase_04 AC 90 ms
15,080 KB
testcase_05 AC 91 ms
15,248 KB
testcase_06 AC 91 ms
15,124 KB
testcase_07 AC 89 ms
15,116 KB
testcase_08 AC 90 ms
15,164 KB
testcase_09 AC 82 ms
15,344 KB
testcase_10 AC 88 ms
15,164 KB
testcase_11 AC 87 ms
15,356 KB
testcase_12 AC 85 ms
15,256 KB
testcase_13 AC 89 ms
15,076 KB
testcase_14 AC 85 ms
15,096 KB
testcase_15 AC 82 ms
15,312 KB
testcase_16 AC 83 ms
15,080 KB
testcase_17 AC 85 ms
15,236 KB
testcase_18 AC 90 ms
15,108 KB
testcase_19 AC 88 ms
15,096 KB
testcase_20 AC 88 ms
15,348 KB
testcase_21 AC 88 ms
15,132 KB
testcase_22 AC 87 ms
15,152 KB
testcase_23 AC 88 ms
15,152 KB
testcase_24 AC 87 ms
15,288 KB
testcase_25 AC 87 ms
15,108 KB
testcase_26 AC 81 ms
15,124 KB
testcase_27 AC 86 ms
15,312 KB
testcase_28 AC 91 ms
15,116 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=80-gets.to_i
P=gets.split.map &:to_i
f=(0..14).to_a
N.times{
  14.downto(0){|m|
    q=(0..m+1).map{|k|
      k<1||k>m ?1:P[m<2?0:k<2||k>m-1?1:2]/1e2
    }
    s=0
    1.upto(m){|i|i.upto(m){|j|
      t=f[j-i+1]*q[i-1]*q[j+1]
      i.upto(j){|k|
        t*=1-q[k]
      }
      s+=t
    }}
    f[m]=s
  }
}
p f[14]*2
0