結果
| 問題 | No.420 mod2漸化式 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-19 01:52:20 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 1,000 ms |
| + 20µs | |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 1,141 ms |
| コンパイル使用メモリ | 155,352 KB |
| 実行使用メモリ | 9,796 KB |
| 最終ジャッジ日時 | 2026-10-19 01:52:24 |
| 合計ジャッジ時間 | 3,517 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 34 |
ソースコード
#include <iostream>
int main() {
using namespace std;
auto comb = [&](int n, int r) -> long long {
long long res = 1;
for (int i = 0; i < r; i++) {
res *= n - i;
res /= i + 1;
}
return res;
};
int x;
cin >> x;
if (x > 31) {
cout << "0 0\n";
} else {
constexpr long long mask = (1LL << 31) - 1;
long long count = comb(31, x);
long long tot = (x > 0) ? comb(30, x - 1) * mask : 0;
cout << count << " " << tot << endl;
}
}