結果
| 問題 |
No.65 回数の期待値の練習
|
| コンテスト | |
| ユーザー |
e6i24v
|
| 提出日時 | 2021-01-02 14:24:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 496 bytes |
| コンパイル時間 | 1,693 ms |
| コンパイル使用メモリ | 168,444 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-12 03:49:32 |
| 合計ジャッジ時間 | 2,525 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//const int MAX=INT_MAX;
//const ll MAX=100000000000;
const ll MAX=90000000000000;
const int mod = 1000000007;
//const int mod = 998244353;
//const ll A=100000000000;
vector<double >dp;
int main(){
int K;
cin>>K;
dp.assign(K+7, 0);
for(int i=K-1;i>=0;i--){
for(int x=1;x<=6;x++){
dp[i]+=(dp[i+x]+1)/6.0;
}
}
printf("%.7lf\n",dp[0]);
}
e6i24v