結果
| 問題 | No.314 ケンケンパ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-08 08:31:08 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 481 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 21,444 KB |
| 最終ジャッジ日時 | 2026-02-23 19:59:23 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:1:1: error: C++ style comments are not allowed in ISO C90
1 | // yukicoder My Practice
| ^
main.c:1:1: note: (this will be reported only once per input file)
main.c: In function ‘main’:
main.c:23:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
ソースコード
// yukicoder My Practice
// author: Leonardone @ NEETSDKASU
#include <stdio.h>
typedef unsigned long ul;
const ul MD = 1000000007UL;
// 解説読後
// http://yukicoder.me/problems/882/editorial
ul a[1000006];
ul *an = a + 3, *an2 = a + 1, *end = a + 1000005;
int main(void) {
*an2 = 1UL;
while (an != end) {
*(an++) = ((*(an - 3)) + (*(an - 4))) % MD;
}
int n;
scanf("%d", &n);
printf("%lu\n", a[n + 4]);
return 0;
}