結果

問題 No.53 悪の漸化式
ユーザー IL_mstaIL_msta
提出日時 2015-07-10 18:57:59
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 988 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 85,868 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 09:49:07
合計ジャッジ時間 1,487 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>

#include <algorithm>
#include <cmath>

#include <string>
#include <array>
#include <list>
#include <queue>
#include <vector>
#include <complex>
#include <set>
#include <map>

/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;

#define PII pair<int,int>
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////

int main(void){
    std::cin.tie(0); 
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed;//
    cout << setprecision(10);//

	int N;
	cin>>N;
	P( 4.0*pow((LD)0.75,N) );
	/*
	if(N==0){P(4.0);return 0;}
	else if(N==1){P(3.0);return 0;}
	LL A[101];
	A[0] = 1;
	A[1] = 3;
	for(int i=2;i<=N;++i){
		A[i] = (19*A[i-1] - 48*A[i-2]);
		cout << A[i] << endl;
		if(A[i] % 4== 0){
			cout << "wa" <<endl;
		}
	}
	LD ans = A[N];
	for(int i=0; i<N-1;++i){
		ans /= 4.0;
	}
	P(ans);
	*/
    return 0;
}
0