結果
問題 |
No.2973 シュニレルマン積分入門
|
ユーザー |
![]() |
提出日時 | 2023-08-04 10:12:59 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 707 bytes |
コンパイル時間 | 7,287 ms |
コンパイル使用メモリ | 343,144 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-29 20:50:36 |
合計ジャッジ時間 | 11,835 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#ifndef DEBUG #pragma GCC target("avx2") #pragma GCC optimize("Ofast,unroll-loops") #endif #include <bits/stdc++.h> #include <atcoder/all> #define rep(i, n) for (int i = 0; i < n; i++) #define ALL(a) a.begin(), a.end() #define vc vector #define ll long long using namespace std; using namespace atcoder; void solve() { int n; cin >> n; if (n > 0) cout << 0 << '\n'; else if (n < 0) { n *= -1; vector<double> a(n + 1); a[0] = 0.1; a[1] = -0.01; for (int i = 2; i <= n; i++) a[i] = -(a[i - 1] + a[i - 2]) / 10; cout << a[n] << '\n'; } else cout << 0.1 << '\n'; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(40); solve(); return 0; }