結果

問題 No.53 悪の漸化式
ユーザー 沙耶花
提出日時 2021-10-21 19:54:52
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 3,977 ms
コンパイル使用メモリ 252,672 KB
最終ジャッジ日時 2025-01-25 02:31:09
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000

int main(){
	
	int N;
	cin>>N;
	
	vector<double> ans(101);
	ans[0] = 4;
	ans[1] = 3;
	
	for(int i=2;i<=100;i++){
		ans[i] = ans[i-1] * 19 - ans[i-2] * 12;
		ans[i] /= 4.0;
	}
	
	cout<<fixed<<setprecision(15)<<ans[N]<<endl;
	
	return 0;
}
0