結果
| 問題 |
No.314 ケンケンパ
|
| コンテスト | |
| ユーザー |
vrjfsyi
|
| 提出日時 | 2018-03-25 00:31:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 491 bytes |
| コンパイル時間 | 498 ms |
| コンパイル使用メモリ | 66,772 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-25 03:22:27 |
| 合計ジャッジ時間 | 2,106 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 RE * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <array>
#include <map>
#include <stack>
#include <queue>
#include <set>
using namespace std;
int main() {
long N;
cin >> N;
long long dp[100001];
constexpr unsigned long long m = 1e9 + 7;
dp[0] = 0;
dp[1] = 1;
dp[2] = 2;
dp[3] = 2;
for (long i = 4; i <= N; ++i) {
dp[i] = (dp[i - 2] + dp[i - 3]) % m;
}
cout << dp[N] << "\n";
return 0;
}
vrjfsyi