結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー tea_pttea_pt
提出日時 2015-05-30 06:50:55
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,334 bytes
コンパイル時間 1,770 ms
コンパイル使用メモリ 81,456 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 17:40:30
合計ジャッジ時間 1,934 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <stack>
#include <array>
#include <fstream>


#define REP(i,n) for(int (i) = 0;(i) < (n) ; ++(i))
#define REPA(a,i,n) for(int (i) = (a) ; (i) < (n) ; ++(i))
#if defined(_MSC_VER)||__cplusplus > 199711L
#define AUTO(r,v) auto r = (v)
#else
#define AUTO(r,v) typeof(v) r = (v)
#endif
#define ALL(c) (c).begin() , (c).end()
#define EACH(it,c) for(AUTO(it,(c).begin());it != (c).end();++it)
#define LL long long
#define int LL
#define INF  999999999999
#define DEV 1000000007
#define QUICK_CIN ios::sync_with_stdio(false); cin.tie(0);
using namespace std;


int N, M;
int a[] = { 2, 3, 5, 7, 11, 13 };
int b[] = { 4, 6, 8, 9, 10, 12 };


signed main()
{
	QUICK_CIN;
	//ifstream cin("debug.txt");
	//ofstream cout("result.txt");

	cin >> N >> M;

	auto ss1 = accumulate(a, a + 6, 0);
	auto ss2 = accumulate(b, b + 6, 0);
	
	double sum = 1;

	REP(i, N){
		sum *= ss1;
	}
	REP(i, M){
		sum *= ss2;
	}

	int aa = 1;

	REP(i, N + M){
		aa *= 6;
	}

	printf("%.12lf", sum / aa);


	return 0;
}
0