結果

問題 No.420 mod2漸化式
ユーザー a0171610
提出日時 2020-05-20 16:23:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 410 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 167,344 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 23:37:01
合計ジャッジ時間 2,855 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i < int(n); i++)
using lint=long long;

signed main(){
	lint comb[40][40]={};
	rep(n,40){
		comb[n][0]=1;
		for(int r=1;r<=n;r++) comb[n][r]=comb[n-1][r-1]+comb[n-1][r];
	}
	lint x; cin >> x;
	if(x > 31){
		cout << "0 0" << endl;
		return 0;
	}
	else printf("%lld %lld\n",comb[31][x],x==0?0:comb[30][x-1]*((1LL<<31)-1));
	return 0;
}
0