結果

問題 No.53 悪の漸化式
ユーザー hotpepsihotpepsi
提出日時 2015-07-05 23:54:48
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 63,376 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 01:06:08
合計ジャッジ時間 1,128 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])
{
	cout.precision(12);
	int N;
	cin >> N;
	long double A[101] = {};
	long double B = 1LL << 50;
	B *= B;
	B *= B;
	A[0] = B * 4, A[1] = B * 3;
	for (int i = 2; i <= N; ++i) {
		A[i] = (19 * A[i - 1] - 12 * A[i - 2]) * 0.25;
	}
	cout << (A[N] / B) << endl;
	return 0;
}
0