結果

問題 No.420 mod2漸化式
ユーザー silopy
提出日時 2019-07-06 00:52:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 404 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 66,972 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 13:35:44
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
using lint=int64_t;

int main()
{
	lint x;

	cin >> x;

	if(x>31)
	{
		cout << "0 0" << endl;
		return 0;
	}

	lint comb[35][35]={};
	for(int i=0;i<=31;i++)
		comb[i][0]=1;
	for(int n=1;n<=31;n++)
		for(int r=1;r<=n;r++)
			comb[n][r]=comb[n-1][r]+comb[n-1][r-1];
	
	cout << comb[31][x] << " " << comb[30][x-1]*2147483647 << endl;
	return 0;
}
0