結果
| 問題 |
No.65 回数の期待値の練習
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-04 19:57:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 277 bytes |
| コンパイル時間 | 1,959 ms |
| コンパイル使用メモリ | 193,504 KB |
| 最終ジャッジ日時 | 2025-01-07 10:41:59 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int k;
cin>>k;
double dp[k+6] {};
for (int i=k-1;k>=0;k--) {
dp[k] = 1;
for (int j=1;j<=6;j++) dp[k] += dp[k+j]/6;
}
cout << dp[0] << endl;
return 0;
}