結果
問題 | No.212 素数サイコロと合成数サイコロ (2) |
ユーザー |
![]() |
提出日時 | 2020-12-22 13:27:26 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 1,962 ms |
コンパイル使用メモリ | 197,004 KB |
最終ジャッジ日時 | 2025-01-17 06:07:31 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 3 |
ソースコード
#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; }