結果

問題 No.567 コンプリート
ユーザー pekempey
提出日時 2017-09-08 22:40:52
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 426 bytes
コンパイル時間 3,053 ms
コンパイル使用メモリ 119,824 KB
最終ジャッジ日時 2025-01-05 02:46:36
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

int main() {
  int n;
  cin >> n;

  vector<double> dp(1 << 6);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    vector<double> dp2(1 << 6);
    for (int j = 0; j < 1 << 6; j++) {
      for (int k = 0; k < 6; k++) {
        dp2[j | 1 << k] += dp[j] / 6;
      }
    }
    dp = dp2;
  }

  printf("%.20f\n", dp[(1 << 6) - 1]);
}
0