結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー 158b158b
提出日時 2015-05-22 23:11:27
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 680 bytes
コンパイル時間 372 ms
使用メモリ 5,164 KB
最終ジャッジ日時 2023-02-08 19:11:49
合計ジャッジ時間 1,230 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <limits.h>
#include <vector>
#include <numeric>
using namespace std;

int main(){
	const int sosuu[6] = {2,3,5,7,11,13};
	const int gousei[6] = {4,6,8,9,10,12};
	const long pat[11] = {1,6,36,216,1296,7776,46656,279936,1679616,10077696,60466176};
	const int sos = 41;
	const int gou = 49;
	int p,c;
	double ans1 = 1;
	double ans2 = 1;
	double ans3;
	
	cin >> p >> c;
	
	for(int i=0; i<p; i++){
		ans1 *= sos;
	}
	ans1 /= pat[p];
	for(int i=0; i<c; i++){
		ans2 *= gou;
	}
	ans2 /= pat[c];
	
	ans3 = ans1 * ans2;
	
	cout.precision(15);
 	cout << fixed << (double) ans3 << endl;
	
	return 0;
}
0