結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2017-07-08 18:03:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 209 bytes |
コンパイル時間 | 268 ms |
コンパイル使用メモリ | 22,400 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 19:47:27 |
合計ジャッジ時間 | 1,382 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 2 | main(){ | ^~~~ main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&N); | ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h> main(){ int N; long long dp[50]; dp[0] = 1; dp[1] = 2; scanf("%d",&N); for(int i = 2;i < N;i++){ dp[i] = dp[i-1] + dp[i-2]; } printf("%lld",dp[N-1]); }