結果
問題 |
No.53 悪の漸化式
|
ユーザー |
![]() |
提出日時 | 2020-11-10 00:07:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 1,830 ms |
コンパイル使用メモリ | 168,208 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-22 17:04:11 |
合計ジャッジ時間 | 2,284 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ cout << fixed << setprecision(20); int N; cin >> N; if (N == 0){ cout << 4 << endl; return 0; } vector<double> A(N + 1); A[0] = 4; A[1] = 3; for (int i = 2; i <= N; i++){ A[i] = (A[i - 1] * 19 - A[i - 2] * 12) / 4; } cout << A[N] << endl; }