結果
問題 | No.53 悪の漸化式 |
ユーザー |
|
提出日時 | 2015-05-10 07:13:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 308 bytes |
コンパイル時間 | 1,033 ms |
コンパイル使用メモリ | 157,672 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 21:22:42 |
合計ジャッジ時間 | 1,623 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:15:21: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘long double’ [-Wformat=] 15 | printf("%.22f\n", A[n]); | ~~~~^ ~~~~ | | | | double long double | %.22Lf
ソースコード
#include "bits/stdc++.h" using namespace std; typedef long long Int; #define REP(i,n) for(int (i)=0;(i)<(int)(n);++(i)) long double A[101]; int main() { A[0] = 4; A[1] = 3; for (int i = 2; i <= 100; i++) { A[i] = (19 * A[i - 1] - 12 * A[i - 2] ) / 4; } int n; cin >> n; printf("%.22f\n", A[n]); }