結果

問題 No.420 mod2漸化式
ユーザー gigime
提出日時 2016-09-09 23:08:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 158,756 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-16 10:56:38
合計ジャッジ時間 2,005 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define PB push_back
#define MP make_pair
#define ALL(x) (x).begin(),(x).end()
typedef long long ll;

ll X;

ll nCr(ll n,ll r)
{
	r = min(n - r,r);
	ll res = 1;

	FOR(i,0,r){
		res *= (n - i);
	}
	FOR(i,0,r){
		res /= (i + 1);
	}

	return res;
}

int main()
{
	cin >> X;

	if(X > 31){
		cout << 0 << ' ' << 0 << endl;
		return 0;
	}

	cout << nCr(31,X) << ' ' << nCr(31,X) * X / 31 * INT_MAX << endl;

	return 0;
}
0