結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2017-11-04 14:34:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 905 bytes |
コンパイル時間 | 683 ms |
コンパイル使用メモリ | 78,552 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-23 17:54:21 |
合計ジャッジ時間 | 1,513 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int main() { long long x; cin >> x; long long combination[31+1][31+1]; for ( int i = 0; i <= 31; i++ ) { for ( int j = 0; j <= i; j++ ) { if ( i == j || j == 0 ) { combination[i][j] = 1; } else { combination[i][j] = combination[i-1][j] + combination[i-1][j-1]; } } } if ( x > 31 ) { cout << 0 << " " << 0 << endl; } else if ( !x ) { cout << 1 << " " << 0 << endl; } else { cout << combination[31][x] << " " << combination[30][x-1] * 2147483647 << endl; } return 0; }