結果
問題 | No.44 DPなすごろく |
ユーザー |
![]() |
提出日時 | 2014-11-11 18:50:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-31 09:41:38 |
合計ジャッジ時間 | 1,123 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf( "%d", &N ); | ~~~~~^~~~~~~~~~~~
ソースコード
#include<cstdio> #define rep(i,a) for(int i=0;i<(a);++i) typedef long long ll; ll fib[51]; int main() { int N; scanf( "%d", &N ); fib[0] = 1; fib[1] = 1; rep( i, N-1 ) fib[i+2] = fib[i] + fib[i+1]; printf( "%lld\n", fib[N] ); return 0; }