| 提出番号 | 1392 |
|---|---|
| 提出者 | square1001 |
| 言語 | C++ |
| 提出日時 | 2018-08-02 20:35:31 |
| 問題名 | (15)掛け算フィボナッチ |
| 結果 | WA |
| 点数 | 0% |
| テストケース | 結果 | 得点 | 実行時間 | メモリ使用量 |
|---|---|---|---|---|
| 1 | WA | 0% | 2ms | 7888KB |
| 2 | WA | 0% | 2ms | 8400KB |
| 3 | WA | 0% | 1ms | 7488KB |
| 4 | WA | 0% | 2ms | 7504KB |
| 5 | WA | 0% | 1ms | 8320KB |
| 6 | WA | 0% | 1ms | 8096KB |
| 7 | WA | 0% | 2ms | 7984KB |
#include <string>
#include <iostream>
using namespace std;
const int mod = 1000000007;
int q, a[100009];
int main() {
a[1] = 1;
int mul = 1;
for (int i = 2; i <= q; ++i) {
a[i] = a[i - 1] + a[i - 2];
if (a[i] >= mod) a[i] -= mod;
mul = 1LL * mul * a[i] % mod;
}
cout << mul << '\n';
return 0;
}