結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2016-09-15 23:24:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 55,816 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-17 06:17:23 |
合計ジャッジ時間 | 1,356 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 32 WA * 3 |
ソースコード
//探索なし解法 #include <iostream> #define int long long using namespace std; int comb[32][32]; signed main() { int i, j, x; for (i = 0; i < 32; i++) { for (j = 0; j <= i; j++) { if (j == 0) comb[i][j] = 1; else comb[i][j] = comb[i-1][j-1] + comb[i-1][j]; } } cin >> x; if (x >= 32) { cout << 0 << endl; return 0; } cout << comb[31][x] << " " << ((x > 0) ? comb[30][x - 1] * 2147483647 : 0) << endl; return 0; }