結果

問題 No.162 8020運動
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-03-06 00:31:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 104 ms / 5,000 ms
コード長 238 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,260 KB
実行使用メモリ 15,424 KB
最終ジャッジ日時 2023-08-27 05:30:20
合計ジャッジ時間 4,340 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,148 KB
testcase_01 AC 90 ms
15,144 KB
testcase_02 AC 93 ms
15,180 KB
testcase_03 AC 99 ms
15,304 KB
testcase_04 AC 98 ms
15,276 KB
testcase_05 AC 104 ms
15,216 KB
testcase_06 AC 99 ms
15,140 KB
testcase_07 AC 97 ms
15,352 KB
testcase_08 AC 98 ms
15,424 KB
testcase_09 AC 84 ms
15,084 KB
testcase_10 AC 95 ms
15,236 KB
testcase_11 AC 93 ms
15,404 KB
testcase_12 AC 87 ms
15,084 KB
testcase_13 AC 99 ms
15,132 KB
testcase_14 AC 86 ms
15,220 KB
testcase_15 AC 85 ms
15,020 KB
testcase_16 AC 89 ms
15,416 KB
testcase_17 AC 87 ms
15,260 KB
testcase_18 AC 98 ms
15,256 KB
testcase_19 AC 95 ms
15,104 KB
testcase_20 AC 97 ms
15,136 KB
testcase_21 AC 98 ms
15,204 KB
testcase_22 AC 97 ms
15,364 KB
testcase_23 AC 98 ms
15,168 KB
testcase_24 AC 97 ms
15,168 KB
testcase_25 AC 96 ms
15,252 KB
testcase_26 AC 87 ms
15,084 KB
testcase_27 AC 92 ms
15,364 KB
testcase_28 AC 99 ms
15,176 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=[1]+(1..m).map{|k|P[m<2?0:k<2||k>m-1?1:2]/1e2}+[1]
s=0
1.upto(m){|i|i.upto(m+1){|j|t=f[j-i]*q[i-1]*q[j];q[i...j].map{|r|t*=1-r};s+=t}}
f[m]=s
m-=1}}
p f[14]*2
0