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 1
1
// @brief Inv of Power Series
2
2
#define PROBLEM " https://judge.yosupo.jp/problem/inv_of_formal_power_series"
3
3
#pragma GCC optimize("Ofast,unroll-loops")
4
- #include " cp-algo/math/poly.hpp"
5
4
#include < bits/stdc++.h>
5
+ #include " blazingio/blazingio.min.hpp"
6
+ #include " cp-algo/math/poly.hpp"
6
7
7
8
using namespace std ;
8
9
using namespace cp_algo ::math;
@@ -15,7 +16,7 @@ void solve() {
15
16
int n;
16
17
cin >> n;
17
18
polyn::Vector a (n);
18
- copy_n (istream_iterator<base>(cin), n, begin (a));
19
+ for ( auto &it: a) {cin >> it;}
19
20
polyn (a).inv_inplace (n).print (n);
20
21
}
21
22
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 1
1
// @brief Polynomial Taylor Shift
2
2
#define PROBLEM " https://judge.yosupo.jp/problem/polynomial_taylor_shift"
3
3
#pragma GCC optimize("Ofast,unroll-loops")
4
- #pragma GCC target("tune=native")
5
4
#include " cp-algo/math/poly.hpp"
6
5
#include < bits/stdc++.h>
7
6
You can’t perform that action at this time.
0 commit comments