結果
問題 |
No.53 悪の漸化式
|
ユーザー |
![]() |
提出日時 | 2015-09-30 10:21:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 1,432 ms |
コンパイル使用メモリ | 159,428 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 18:09:33 |
合計ジャッジ時間 | 2,765 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:16: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘__gnu_cxx::__alloc_traits<std::allocator<long double>, long double>::value_type’ {aka ‘long double’} [-Wformat=] 17 | printf("%.9f\n", A[N]); | ~~~^ | | | double | %.9Lf
ソースコード
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) #define FOR(i, a, b) for(int i=(a);i<(b);i++) int N; vector<long double> A(200); signed main() { cin >> N; A[0] = 4.0; A[1] = 3.0; FOR(i,2,N+1) { A[i] = (19 * A[i-1] - 12 * A[i-2]) / 4.0; } printf("%.9f\n", A[N]); return 0; }