結果

問題 No.420 mod2漸化式
ユーザー かにかに
提出日時 2016-10-02 21:46:01
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 1,179 ms
コンパイル使用メモリ 159,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-01 09:39:21
合計ジャッジ時間 2,235 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 0 ms
6,940 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 1 ms
6,940 KB
testcase_29 AC 1 ms
6,944 KB
testcase_30 AC 1 ms
6,944 KB
testcase_31 AC 1 ms
6,940 KB
testcase_32 AC 2 ms
6,944 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 1 ms
6,940 KB
testcase_35 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define _CRT_SECURE_NO_WARNINGS
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define Pi pair<int,int>
#define IINF 1e9
#define LINF 1e18
#define vi vector<int>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 0, 1,0,-1 };
int dy[] = { 1, 0,-1,0 };

ll comb(ll n, ll k) {
	ll ans = 1;
	for (ll i = 0; i < min(k, n - k); i++) {
		ans *= n - i;
		ans /= i + 1;
	}
	return ans;
}

void solve() {
	int n;
	cin >> n;
	ll num, sum;
	if (n >= 32) {
		cout << 0 << " " << 0;
	}
	else {
		num = comb(31, n);
		sum = (pow(2, 31) - 1)*comb(30, n - 1);
		cout << num << " " << sum << endl;
	}
}

int main() {
	solve();
	return 0;
}
0