結果
| 問題 | No.567 コンプリート | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-11-21 00:17:23 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 631 bytes | 
| コンパイル時間 | 2,178 ms | 
| コンパイル使用メモリ | 192,692 KB | 
| 最終ジャッジ日時 | 2025-01-25 23:47:18 | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 11 TLE * 1 | 
ソースコード
#include <bits/stdc++.h>
 
using namespace std;
double dp[1000001][1<<6];
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    dp[0][0] = 1;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<(1<<6);j++)
        {
            for(int k=0;k<6;k++)
            {
                int bitmask = j;
                if((bitmask&(1<<k))==0)
                {
                    bitmask += (1<<k);
                }
                dp[i+1][bitmask] += (dp[i][j]/6);
            }
        }
    }
    cout << fixed;
    cout.precision(16);
    cout << dp[n][63] << '\n';
    return 0;
}
            
            
            
        