結果

問題 No.53 悪の漸化式
ユーザー btk
提出日時 2015-05-23 11:48:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 55,024 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 06:07:42
合計ジャッジ時間 1,104 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:22: warning: format ‘%lf’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=]
   10 |         printf("%.11lf\n",num[n]+eps);
      |                 ~~~~~^    ~~~~~~~~~~
      |                      |          |
      |                      double     long double
      |                 %.11Lf

ソースコード

diff #

#include<iostream>
#include<stdio.h>
using namespace std;
const long double eps=1e-12;
int main(){
	long double num[101]={4.0,3.0};
	int n;cin>>n;
	for(int i=2;i<=n;i++)
		num[i]=(num[i-1]*19.0-num[i-2]*12.0)/4.0;
	printf("%.11lf\n",num[n]+eps);
}
0