結果

問題 No.242 ビンゴゲーム
ユーザー 👑 jupirojupiro
提出日時 2020-07-16 02:31:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,475 bytes
コンパイル時間 1,318 ms
コンパイル使用メモリ 127,940 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-02 09:05:53
合計ジャッジ時間 1,794 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;
const long double PI = acos((long double)(-1));

using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;


constexpr int mx = 100;
ld COM[mx + 1][mx + 1] = {};

void COMinit(void) {
	for (ll i = 0; i <= mx; i++) {
		for (ll j = 0; j <= i; j++) {
			if (j == 0 || j == i) {
				COM[i][j] = 1;
			}
			else {
				COM[i][j] = COM[i - 1][j - 1] + COM[i - 1][j];
			}
		}
	}
}

int main()
{
    /*
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    */

	COMinit();
	int n; cin >> n;
	ld res = COM[n][5] / COM[99][5];
	res *= 12;
	cout << fixed << setprecision(12) << res << endl;
    return 0;
}
0