結果
問題 | No.420 mod2漸化式 |
ユーザー |
|
提出日時 | 2016-09-09 22:49:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 911 bytes |
コンパイル時間 | 2,798 ms |
コンパイル使用メモリ | 167,128 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 11:05:14 |
合計ジャッジ時間 | 3,002 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS#define _USE_MATH_DEFINES#include "bits/stdc++.h"#define REP(i,a,b) for(i=a;i<b;++i)#define rep(i,n) REP(i,0,n)#define ll long long#define ull unsigned lltypedef long double ld;#define ALL(a) begin(a),end(a)#define ifnot(a) if(not a)#define dump(x) cerr << #x << " = " << (x) << endlusing namespace std;// #define int llbool test = 0;int dx[] = { 0,1,0,-1 };int dy[] = { 1,0,-1,0 };#define INF (1 << 28)ull mod = (int)1e9 + 7;//.....................#define MAX (int)1e6 + 5template<typename T>T combi(T n, T r) {T i;T rep = 1;if (r > n / 2) r = n - r;rep(i, r) {rep *= n - i;rep /= i + 1;}return rep;}signed main(void) {ll i, j, k, l;ll x;cin >> x;if (x > 31) {puts("0 0");return 0;}ll a = combi((ll)31, x);ll sum = 0;rep(i, 31) {sum += a * x / 31 * (1<<i);}cout << a << " " << sum << endl;return 0;}