結果
問題 | No.813 ユキちゃんの冒険 |
ユーザー |
|
提出日時 | 2019-04-14 17:16:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 814 ms |
コンパイル使用メモリ | 69,032 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 06:39:01 |
合計ジャッジ時間 | 1,674 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 4 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#include <string>#include <map>#include <cstring>using namespace std;int N;double P, Q;double dp[1010];int main() {cin >> N >> P >> Q;dp[N - 1] = Q;for (int i = N - 2; i >= 0; i--) {dp[i] = P + Q * dp[i+1] * Q / (1 - dp[i+1]*P);}printf("%.15f\n", dp[0]);}