結果

問題 No.44 DPなすごろく
ユーザー vjudge1
提出日時 2024-02-19 22:57:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 269 bytes
コンパイル時間 1,860 ms
コンパイル使用メモリ 191,164 KB
最終ジャッジ日時 2025-02-19 17:30:46
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

#define mod 998244353


int main( void)
{   

      int n; cin >> n;
      long long a[51];
      a[1] = 1; a[2] =2;
      for( int i =3; i<= n; i++)
      {
            a[i] = a[i-1] + a[i-2];
      }
      cout<< a[n];
}
0