結果
問題 |
No.65 回数の期待値の練習
|
ユーザー |
|
提出日時 | 2016-11-21 00:44:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 1,900 ms |
コンパイル使用メモリ | 166,868 KB |
実行使用メモリ | 814,848 KB |
最終ジャッジ日時 | 2024-11-27 09:19:57 |
合計ジャッジ時間 | 28,932 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 4 |
other | MLE * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; int N; double dfs( int x, int t ){ if( x >= N ) return 1.0 * t; double res = 0; for( int i = 1; i <= 6; ++i ) res += dfs( x, t + 1 ); return res / 6; } signed main(){ cin >> N; // vector< vector< double > > dp( N + 1, vector< double >( N + 6, -1 ) ); cout << fixed << setprecision( 13 ) << dfs( 0, 0 ) << endl; return 0; }