結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー hotpepsihotpepsi
提出日時 2015-05-24 00:37:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 575 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 63,184 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 10:56:05
合計ジャッジ時間 1,042 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <cstdio>

using namespace std;

int main(int argc, char *argv[])
{
	cout.precision(16);
	int a[2][6] = {
		{ 2, 3, 5, 7, 11, 13 },
		{ 4, 6, 8, 9, 10, 12 }
	};
	int s1 = accumulate(a[0], a[0] + 6, 0);
	int s2 = accumulate(a[1], a[1] + 6, 0);
	string s;
	getline(cin, s);
	stringstream ss(s);
	int P, C;
	ss >> P >> C;
	long double ans = 1.0;
	for (int i = 0; i < P; ++i) {
		ans *= (s1 / 6.0);
	}
	for (int i = 0; i < C; ++i) {
		ans *= (s2 / 6.0);
	}
	cout << ans << endl;
	return 0;
}
0