結果

問題 No.567 コンプリート
ユーザー snrnsidysnrnsidy
提出日時 2021-11-21 00:18:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 565 bytes
コンパイル時間 2,283 ms
コンパイル使用メモリ 198,880 KB
実行使用メモリ 187,448 KB
最終ジャッジ日時 2023-09-03 01:44:17
合計ジャッジ時間 6,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,500 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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++)
        {
            if(dp[i][j]<=0) continue;
            for(int k=0;k<6;k++)
            {
                int bitmask = (j | (1<<k));
                dp[i+1][bitmask] += (dp[i][j]/6);
            }
        }
    }

    cout << fixed;
    cout.precision(16);

    cout << dp[n][63] << '\n';

    return 0;
}
0