結果

問題 No.790 ちきんの括弧並べ
ユーザー Mcpu3
提出日時 2019-02-20 22:22:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 63,744 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 19:39:04
合計ジャッジ時間 1,223 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

__int128 factorial(__int128 a) {
	__int128 tmp = 1;
	for (__int128 i = 2; i <= a; ++i) tmp *= i;
	return tmp;
}

int main() {
	long tmp;
	cin >> tmp;
	__int128 N = tmp;
	long ans = factorial(2 * N) / (factorial(N + 1) * factorial(N));
	cout << ans;
}
0