結果
問題 |
No.3172 三角関数べき乗のフーリエ級数展開
|
ユーザー |
|
提出日時 | 2025-06-07 16:40:47 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,669 bytes |
コンパイル時間 | 3,258 ms |
コンパイル使用メモリ | 215,136 KB |
実行使用メモリ | 16,068 KB |
最終ジャッジ日時 | 2025-06-07 16:40:54 |
合計ジャッジ時間 | 7,065 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | TLE * 1 -- * 14 |
ソースコード
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define int int64_t template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define pi pair<int, int> #define vi vector<int> #define pb push_back #define all(x) (x).begin(), (x).end() template <typename T> istream &operator>>(istream &in, vector<T> &v) { for (auto &x : v) in >> x; return in; } template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) { for (const auto &x : v) out << x << ' '; return out; } template <typename T1, typename T2> istream &operator>>(istream &in, pair<T1, T2> &p) { in >> p.first >> p.second; return in; } template <typename T1, typename T2> ostream &operator<<(ostream &out, const pair<T1, T2> &p) { out << p.first << ' ' << p.second; return out; } const int MOD = 998244353; const int N = 200001; void solve() { int n; cin >> n; int k = 2 * (n >> 1); vector<int> a(N, 0), prev(N, 0); prev[0] = 1; for (int i = 0; i < n; i++) { a[0] = prev[1]; a[1] = 2 * prev[0] + prev[2]; a[n - 1] = prev[n - 2]; for (int j = 2; j < n - 1; j++) a[j] = prev[j - 1] + prev[j + 1]; for (int j = 0; j < n; j++) prev[j] = a[j]; } for (int i = 0; i <= n; i++) cout << a[i] << " "; cout << '\n'; } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t = 1; while (t--) solve(); return 0; }