結果
| 問題 |
No.420 mod2漸化式
|
| ユーザー |
startcpp
|
| 提出日時 | 2016-09-15 23:29:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 54,388 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 13:01:30 |
| 合計ジャッジ時間 | 1,644 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
//探索なし解法
#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 << " " << 0 << endl; return 0; }
cout << comb[31][x] << " " << ((x > 0) ? comb[30][x - 1] * 2147483647 : 0) << endl;
return 0;
}
startcpp