結果

問題 No.53 悪の漸化式
ユーザー 沙耶花沙耶花
提出日時 2021-10-21 19:54:52
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 3,602 ms
コンパイル使用メモリ 263,508 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 15:01:51
合計ジャッジ時間 4,502 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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