File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 11// @brief Inv of Power Series
22#define PROBLEM " https://judge.yosupo.jp/problem/inv_of_formal_power_series"
33#pragma GCC optimize("Ofast,unroll-loops")
4- #include " cp-algo/math/poly.hpp"
54#include < bits/stdc++.h>
5+ #include " blazingio/blazingio.min.hpp"
6+ #include " cp-algo/math/poly.hpp"
67
78using namespace std ;
89using namespace cp_algo ::math;
@@ -15,7 +16,7 @@ void solve() {
1516 int n;
1617 cin >> n;
1718 polyn::Vector a (n);
18- copy_n (istream_iterator<base>(cin), n, begin (a));
19+ for ( auto &it: a) {cin >> it;}
1920 polyn (a).inv_inplace (n).print (n);
2021}
2122
Original file line number Diff line number Diff line change 1+ // @brief Conversion to Newton Basis
2+ #define PROBLEM " https://judge.yosupo.jp/problem/conversion_from_monomial_basis_to_newton_basis"
3+ #pragma GCC optimize("Ofast,unroll-loops")
4+ #include " cp-algo/math/poly.hpp"
5+ #include < bits/stdc++.h>
6+
7+ using namespace std ;
8+ using namespace cp_algo ::math;
9+
10+ const int mod = 998244353 ;
11+ using base = modint<mod>;
12+ using polyn = poly_t <base>;
13+
14+ void solve () {
15+ int n;
16+ cin >> n;
17+ polyn::Vector a (n), p (n);
18+ copy_n (istream_iterator<base>(cin), n, begin (a));
19+ copy_n (istream_iterator<base>(cin), n, begin (p));
20+ polyn (a).to_newton (p).print (n);
21+ }
22+
23+ signed main () {
24+ // freopen("input.txt", "r", stdin);
25+ ios::sync_with_stdio (0 );
26+ cin.tie (0 );
27+ int t;
28+ t = 1 ;// cin >> t;
29+ while (t--) {
30+ solve ();
31+ }
32+ }
Original file line number Diff line number Diff line change 11// @brief Polynomial Taylor Shift
22#define PROBLEM " https://judge.yosupo.jp/problem/polynomial_taylor_shift"
33#pragma GCC optimize("Ofast,unroll-loops")
4- #pragma GCC target("tune=native")
54#include " cp-algo/math/poly.hpp"
65#include < bits/stdc++.h>
76
You can’t perform that action at this time.
0 commit comments