結果
問題 |
No.65 回数の期待値の練習
|
ユーザー |
|
提出日時 | 2016-12-23 21:17:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 497 bytes |
コンパイル時間 | 679 ms |
コンパイル使用メモリ | 80,820 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 17:04:09 |
合計ジャッジ時間 | 1,535 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
#define _USE_MATH_DEFINES #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; double r[40] = {}; while (t--) { r[t] = 1 + (r[t + 1] + r[t + 2] + r[t + 3] + r[t + 4] + r[t + 5] + r[t + 6]) / 6 ; } cout << r[0] << endl; return 0; }