結果
| 問題 | No.314 ケンケンパ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-08 08:19:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 585 bytes |
| 記録 | |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 55,820 KB |
| 実行使用メモリ | 11,096 KB |
| 最終ジャッジ日時 | 2024-09-14 19:33:51 |
| 合計ジャッジ時間 | 1,186 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 16 |
ソースコード
// yukicoder My Practice
// author: Leonardone @ NEETSDKASU
#include <cstdio>
#include <iostream>
using namespace std;
typedef unsigned long ul;
const ul MD = 1000000007UL;
// 解説読後
// http://yukicoder.me/problems/882/editorial
#define arrlen(x) (sizeof(x) / sizeof((x)[0]))
char str[100];
ul a[1000006];
int main() {
int n;
cin >> n;
ul *an = a + 3, *an2 = a + 1, *an3 = a, *enda = a + size_t(n) + 5;
*an2 = 1UL;
while (an != enda) {
*(an++) = ((*(an - 3)) + (*(an - 4))) % MD;
}
cout << a[n + 4] << endl;
return 0;
}