結果

問題 No.420 mod2漸化式
ユーザー silopysilopy
提出日時 2019-07-06 00:55:36
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 456 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 67,528 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 13:38:37
合計ジャッジ時間 1,751 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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==0)
	{
		cout << "1 0" << endl;
		return 0;
	}
	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