結果
問題 |
No.44 DPなすごろく
|
ユーザー |
![]() |
提出日時 | 2015-05-04 21:32:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 507 ms |
コンパイル使用メモリ | 66,412 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 19:00:01 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <iostream> #include <iomanip> #include <sstream> #include <string> #include <cmath> #include <iostream> using namespace std; int main() { int N; cin >> N; long long pat[51]; pat[0] = 1; pat[1] = 1; for (int i = 2; i <= N;i++){ pat[i] = pat[i-1] + pat[i-2]; } cout << fixed << pat[N] << endl; return 0; }