結果

問題 No.144 エラトステネスのざる
ユーザー gigurururugigurururu
提出日時 2015-02-05 23:46:56
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 120 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 11,400 KB
実行使用メモリ 35,196 KB
最終ジャッジ日時 2023-09-05 13:12:01
合計ジャッジ時間 5,168 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
19,668 KB
testcase_01 AC 80 ms
15,104 KB
testcase_02 WA -
testcase_03 AC 81 ms
15,060 KB
testcase_04 AC 80 ms
15,072 KB
testcase_05 AC 82 ms
15,176 KB
testcase_06 AC 85 ms
15,072 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 85 ms
15,144 KB
testcase_12 AC 81 ms
15,124 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N,P=gets.split.map(&:to_f)
l=[0,0]+[1.0]*(N-1)
s=0
(2..N).each{|i|
  s+=t=l[i]
  (i+i).step(N,i){|j|l[j]*=t*(1-P)}
}
p s
0