結果
問題 |
No.65 回数の期待値の練習
|
ユーザー |
![]() |
提出日時 | 2018-11-12 16:54:57 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 1,678 ms |
コンパイル使用メモリ | 194,272 KB |
最終ジャッジ日時 | 2025-01-06 16:31:10 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
#include<bits/stdc++.h> using namespace std; using Int = long long; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} struct Precision{ Precision(){ cout<<fixed<<setprecision(12); } }precision_beet; //INSERT ABOVE HERE signed main(){ int k; cin>>k; const int MAX = 100; vector<double> dp(MAX,0); for(int i=k-1;i>=0;i--){ dp[i]=1; for(int j=1;j<=6;j++) dp[i]+=dp[i+j]/6; } cout<<dp[0]<<endl; return 0; }