結果

問題 No.53 悪の漸化式
ユーザー Lay_ec
提出日時 2014-10-30 23:45:13
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 391 bytes
コンパイル時間 964 ms
コンパイル使用メモリ 71,304 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 14:45:20
合計ジャッジ時間 1,597 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>

using namespace std;


int main()
{	
	int n;
	cin>>n;

	if(n==0) cout<<4<<endl;
	else if(n==1) cout<<3<<endl;
	else printf("%.16f\n",pow(3.0,n)/pow(2.0,(n-1)*2));
	

	return 0;
}
0