File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,17 @@ namespace cp_algo::math {
43
43
normalize ();
44
44
return *this ;
45
45
}
46
- poly_t & div_xk_inplace (size_t k) {
47
- a.erase (begin (a), begin (a) + std::min (k, size (a)));
46
+ poly_t & div_xk_inplace (int64_t k) {
47
+ if (k < 0 ) {
48
+ return mul_xk_inplace (-k);
49
+ }
50
+ a.erase (begin (a), begin (a) + std::min<size_t >(k, size (a)));
48
51
normalize ();
49
52
return *this ;
50
53
}
51
54
poly_t mod_xk (size_t k) const {return poly_t (*this ).mod_xk_inplace (k);}
52
55
poly_t mul_xk (size_t k) const {return poly_t (*this ).mul_xk_inplace (k);}
53
- poly_t div_xk (size_t k) const {return poly_t (*this ).div_xk_inplace (k);}
56
+ poly_t div_xk (int64_t k) const {return poly_t (*this ).div_xk_inplace (k);}
54
57
55
58
poly_t substr (size_t l, size_t k) const {return poly::impl::substr (*this , l, k);}
56
59
You can’t perform that action at this time.
0 commit comments