結果
| 問題 | No.53 悪の漸化式 |
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2024-07-30 12:59:19 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 623µs | |
| コード長 | 660 bytes |
| 記録 | |
| コンパイル時間 | 4,294 ms |
| コンパイル使用メモリ | 371,260 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-08-24 17:47:40 |
| 合計ジャッジ時間 | 5,763 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;
#include<iomanip>
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin>>n;
if(n==0) cout<<4<<endl;
else if(n==1) cout<<3<<endl;
else{
mp::cpp_dec_float_100 a = 4;
mp::cpp_dec_float_100 b = 3;
for(int i = 2;i<=n;i++){
mp::cpp_dec_float_100 c = 19 * b - 12 * a;
c /= 4;
a = b;
b = c;
}
cout<<setprecision(30)<<fixed<<b<<endl;
}
}
momoyuu