結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2015-07-13 00:40:24 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 229 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 06:13:23 |
合計ジャッジ時間 | 933 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d", &n); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ int i,n; long long int ans[60]; ans[0] = 0; ans[1] = 1; ans[2] = 2; scanf("%d", &n); for(i=3;i<=n;i++){ ans[i] = ans[i-2] + ans[i-1]; } printf("%lld\n", ans[n]); return 0; }