MCPcopy Create free account
hub / github.com/atcoder/ac-library / conv_naive

Function conv_naive

test/unittest/convolution_test.cpp:26–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25template <class mint, internal::is_static_modint_t<mint>* = nullptr>
26std::vector<mint> conv_naive(std::vector<mint> a, std::vector<mint> b) {
27 int n = int(a.size()), m = int(b.size());
28 std::vector<mint> c(n + m - 1);
29 for (int i = 0; i < n; i++) {
30 for (int j = 0; j < m; j++) {
31 c[i + j] += a[i] * b[j];
32 }
33 }
34 return c;
35}
36
37template <int MOD,
38 class T,

Callers 1

TESTFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected