結果

問題 No.242 ビンゴゲーム
ユーザー btkbtk
提出日時 2015-07-10 23:52:55
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,880 bytes
コンパイル時間 620 ms
コンパイル使用メモリ 89,488 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-22 10:25:30
合計ジャッジ時間 1,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
#include<iomanip>
using namespace std;
/*
const int bingo[] = { 32505856, 1015808, 31744, 992, 31, 17318416, 8659208, 4329604, 2164802, 1082401, 17043521, 1118480 };
int ans[30];
int bns[30];
int main(void){
	ofstream cout("out.txt");
	for (int i = 0; i < (1<<25); i++){
		int cnt = 0;
		for (int j = 0; j < 30; j++){
			if ((1 << j)&i)cnt++;
		}
		int res = 0;
		for (int j = 0; j < 12; j++){
			if ((i&bingo[j]) == bingo[j])res++;
		}
		bns[cnt]++;
		ans[cnt] += res;
	}
	for (int i = 0; i < 30; i++){
		cout << ans[i] <<"/(double)" <<bns[i] << "," << endl;
	}
	cout.close();
	return(0);
}
*/
#define double long double
double umekomi[] = {
	0 / (double)1,
	0 / (double)25,
	0 / (double)300,
	0 / (double)2300,
	0 / (double)12650,
	12 / (double)53130,
	240 / (double)177100,
	2280 / (double)480700,
	13680 / (double)1081575,
	58140 / (double)2042975,
	186048 / (double)3268760,
	465120 / (double)4457400,
	930240 / (double)5200300,
	1511640 / (double)5200300,
	2015520 / (double)4457400,
	2217072 / (double)3268760,
	2015520 / (double)2042975,
	1511640 / (double)1081575,
	930240 / (double)480700,
	465120 / (double)177100,
	186048 / (double)53130,
	58140 / (double)12650,
	13680 / (double)2300,
	2280 / (double)300,
	240 / (double)25,
	12 / (double)1
};
int main(){
	cout << fixed;
	int N;
	cin >> N;
	double res=0;
	double all=0;
	for (int i = 0; i <= min(N,25); i++){
		double p = 1;
		for (int j = 0; j < i; j++){
			p *= N - j;
			p /= (j + 1);
		}
		//cout << p << endl;
		all += p;
		res += p*umekomi[i];
	}
	//cout << all << endl;
	cout << res / all << endl;
}
0