結果
問題 |
No.567 コンプリート
|
ユーザー |
![]() |
提出日時 | 2017-09-10 10:10:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,623 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 2,207 ms |
コンパイル使用メモリ | 195,460 KB |
最終ジャッジ日時 | 2025-01-05 02:53:42 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ld = long double; int main() { vector<ld> dp(7); dp[0] = 1; int N; cin >> N; for (int i = 0; i < N; i++) { auto t = dp; fill(dp.begin(), dp.end(), (ld)0); for (int j = 0; j <= 6; j++) { dp[j] += t[j] * ((ld)j / 6); if (j != 6) dp[j + 1] += t[j] * ((ld)(6 - j) / 6); } } cout << fixed << setprecision(9) << dp[6] << endl; return 0; }