結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー maine_honzukimaine_honzuki
提出日時 2020-12-22 13:27:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 204,980 KB
実行使用メモリ 305,372 KB
最終ジャッジ日時 2023-10-21 12:53:53
合計ジャッジ時間 3,494 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 17 ms
13,456 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int P, C;
    cin >> P >> C;
    int A[2][6]{{2, 3, 5, 7, 11, 13}, {4, 6, 8, 9, 10, 12}};
    vector<int> now(1, 1);
    for (int _ = 0; _ < P + C; _++) {
        vector<int> nxt;
        for (auto& x : now)
            for (int i = 0; i < 6; i++)
                nxt.emplace_back(x * A[_ >= P][i]);
        swap(now, nxt);
    }

    double ans = 0;
    for (auto& x : now)
        ans += 1.0 * x / now.size();

    cout << fixed << setprecision(10) << ans << endl;
}
0