結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2016-09-11 14:15:51 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,047 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 82,248 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 11:33:05 |
合計ジャッジ時間 | 1,958 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <cmath>#include <vector>#include <map>#include <functional>#include <queue>#include <iostream>#include <string>#include <iomanip>#include <algorithm>#include <functional>#include <cstdint>#include <climits>using namespace std;#define ll long long int#define ti4 tuple<int,int,int,int>#define pii pair<ll,ll>template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T &val){std::fill( (T*)array, (T*)(array+N), val );}ll comb(ll n, ll a){ll c = 1;for(ll i = 1;i < 1 + a;i++){ll v = n - i + 1;c *= v;c /= i;}return c;}int main(){ll x;cin >> x;if(x > 31){cout << "0 0" << endl;return 0;}if(x == 0){cout << "1 0" << endl;return 0;}ll v = x >= 16 ? 31 - x : x;ll count = comb(31, v);ll m = INT_MAX;ll t = x - 1;if(t >= 16){t = 30 - t;}m *= comb(30, t);cout << count << " " << m << endl;return 0;}