結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
|
| 提出日時 | 2018-07-11 17:20:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 210 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-19 19:12:23 |
| 合計ジャッジ時間 | 1,118 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%ld", &N);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<cstdio>
int main(void) {
long int N, a[3], i;
scanf("%ld", &N);
a[0] = 1;
a[1] = 1;
for (i = 0; N > i+2; i++) {
a[2] = a[1] + a[0];
a[0] = a[1];
a[1] = a[2];
}
printf("%ld", a[2]);
return 0;
}