結果
問題 | No.2461 一点張り |
ユーザー | 👑 horiesiniti |
提出日時 | 2023-09-22 17:00:59 |
言語 | Ruby (3.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 219 bytes |
コンパイル時間 | 48 ms |
コンパイル使用メモリ | 11,456 KB |
実行使用メモリ | 15,568 KB |
最終ジャッジ日時 | 2023-09-22 17:01:01 |
合計ジャッジ時間 | 1,489 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
15,488 KB |
testcase_01 | WA | - |
testcase_02 | AC | 81 ms
15,428 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 86 ms
15,460 KB |
testcase_07 | WA | - |
コンパイルメッセージ
Syntax OK
ソースコード
t=gets.to_i t.times{ p1,k1=gets.split(" ") p1=p1.to_f k1=k1.to_i ans=1 if k1==1 then ans=1.0 elsif k1==2 then ans=p1+2.0*(1-p1) else qk=(1-p1)**(k1-1) ans=(1.0-qk)/p1+qk end puts sprintf("%.12f", ans) }