結果

問題 No.420 mod2漸化式
ユーザー kapokapo
提出日時 2016-09-10 00:19:15
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,258 bytes
コンパイル時間 594 ms
コンパイル使用メモリ 80,932 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-28 06:10:22
合計ジャッジ時間 3,074 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

ll ans = 0;
ll sum = 0;
int x = 0;

void calc(ll s, int n, int cnt) {
	if (n == 32 && cnt < x) return;
	if (cnt == x) {
		//debug(s);
		ans++;
		sum += s;
		return;
	}
	if (32-n < x-cnt) return;
	ll a = pow(2,n);
	calc(s+a, n+1, cnt+1);
	calc(s, n+1, cnt);
}

int main()
{
	cin >> x;
	calc(0, 1, 0);

	cout << ans << " " << sum/2 << endl;

	return 0;
}
0