結果

問題 No.53 悪の漸化式
ユーザー lunnear
提出日時 2018-11-20 14:15:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 54,360 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 15:28:43
合計ジャッジ時間 1,246 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main()
{
    int n;
    std::cin >> n;
    
    double a[101];
    a[0] = 4;
    a[1] = 3;
    
    for(int i = 2; i <= n; i++)
    {
        a[i] = (4.75 * a[i - 1]) - (3 * a[i - 2]);
    }
    
    std::cout << a[n] << std::endl;
    
    return 0;
}
0