結果
問題 | No.212 素数サイコロと合成数サイコロ (2) |
ユーザー |
👑 ![]() |
提出日時 | 2020-09-26 15:18:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 472 bytes |
コンパイル時間 | 1,455 ms |
コンパイル使用メモリ | 166,572 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 02:36:48 |
合計ジャッジ時間 | 2,054 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) int dice1[6] = { 2,3,5,7,11,13 }; int dice2[6] = { 4,6,8,9,10,12 }; int main() { int P, C; cin >> P >> C; double dice1P = 0; rep(i, 6) dice1P += dice1[i]; dice1P /= 6.; double dice2P = 0; rep(i, 6) dice2P += dice2[i]; dice2P /= 6.; double ans = 1.; rep(i, P) ans *= dice1P; rep(i, C) ans *= dice2P; cout << setprecision(11) << ans << endl; return 0; }