結果
| 問題 | No.420 mod2漸化式 |
| コンテスト | |
| ユーザー |
kyuna
|
| 提出日時 | 2019-07-21 02:14:07 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 473µs | |
| コード長 | 725 bytes |
| 記録 | |
| コンパイル時間 | 372 ms |
| コンパイル使用メモリ | 90,824 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-09 23:45:50 |
| 合計ジャッジ時間 | 2,231 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<vector<long long>> get_combination(int ma) {
vector<vector<long long>> mat(ma + 1, vector<long long>(ma + 1));
for (int n = 0; n <= ma; n++) mat[n][0] = 1;
for (int n = 1; n <= ma; n++) for (int r = 1; r <= n; r++) {
mat[n][r] = mat[n - 1][r - 1] + mat[n - 1][r];
}
return mat;
}
int main() {
int x; cin >> x;
if (x == 0) {
cout << "1 0" << endl;
return 0;
}
if (x > 31) {
cout << "0 0" << endl;
return 0;
}
vector<vector<long long>> comb = get_combination(31);
cout << comb[31][x] << " " << comb[30][x - 1] * ~-(1LL << 31) << endl;
return 0;
}
kyuna