結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
|
| 提出日時 | 2025-09-23 11:52:55 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 330µs | |
| コード長 | 417 bytes |
| 記録 | |
| コンパイル時間 | 1,904 ms |
| コンパイル使用メモリ | 331,104 KB |
| 実行使用メモリ | 9,916 KB |
| 最終ジャッジ日時 | 2026-10-11 08:35:23 |
| 合計ジャッジ時間 | 3,436 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include <bits/stdc++.h>
[[nodiscard]] static inline constexpr int_fast64_t solve(const int_fast64_t N) noexcept
{
std::array<int_fast64_t, 2> dp = { 1, 1 };
for (int_fast32_t i = 2; i <= N; ++i)
dp[i & 1] = dp[i & 1] + dp[(i & 1) ^ 1];
return dp[N & 1];
}
int main()
{
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int_fast32_t N;
std::cin >> N;
std::cout << solve(N) << '\n';
return 0;
}