結果
問題 | No.57 ミリオンダイス |
ユーザー |
![]() |
提出日時 | 2017-10-09 17:43:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 689 bytes |
コンパイル時間 | 562 ms |
コンパイル使用メモリ | 74,140 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 06:59:03 |
合計ジャッジ時間 | 1,135 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <iomanip> #define REP(i, a, b) for (int i = int(a); i < int(b); i++) using namespace std; typedef long long int lli; int main() { int N; cin >> N; /* vector<vector<lli>> dp(N + 1, vector<lli>(6 * N + 1, 0)); dp[0][0] = 1; REP (i, 0, N) REP (j, 0, 6 * N + 1) { REP (k, 1, 7) { if (j + k <= 6 * N) dp[i + 1][j + k] += dp[i][j]; } } double ans = 0.0; REP (i, 0, 6 * N + 1) ans += dp[N][i] * i; REP (i, 0, N) ans /= 6; cout << fixed << setprecision(10) << ans << endl; */ cout << fixed << setprecision(10) << 3.5 * N << endl; return 0; }