結果
| 問題 |
No.53 悪の漸化式
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-27 07:49:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 353 bytes |
| コンパイル時間 | 647 ms |
| コンパイル使用メモリ | 60,892 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 18:57:58 |
| 合計ジャッジ時間 | 1,605 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 6 |
ソースコード
#include <iostream>
#include <iomanip>
using namespace std;
int n;
double x;
void rec(int a,double b,double c){
double y=(19*b-12*c)/4;
if(a==n){
x=y;
} else {
rec(a+1,y,b);
}
}
int main(){
cin>>n;
if(n==0){
x=4;
} else if(n==1){
x=3;
} else {
rec(2,3,4);
}
cout<<fixed<<setprecision(12)<<x<<endl;
return 0;
}