MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / multiply

Function multiply

test/test_fft.cpp:36–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34#include "fft_implementation_modular_arithmetic.h"
35
36vector<int> multiply(vector<int> a, vector<int> b) {
37 int n = root_pw;
38 a.resize(root_pw);
39 b.resize(root_pw);
40
41 fft(a, false);
42 fft(b, false);
43 for (int i = 0; i < n; i++)
44 a[i] = (int)(1LL * a[i] * b[i] % mod);
45 fft(a, true);
46
47 return a;
48}
49}
50
51int main() {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected