版本比较
题解:P1916 Hermite 多点求值 / 多点 Taylor 展开
正文
增加 6 行删除 6 行
201 行未改动全部展开20220320420520620720820921021121239 行未改动25225325425525625725825926026126226326426521 行未改动28728828929029129229329429510 行未改动201 行未改动全部展开{int mid = (l + r) / 2;build_segment_tree(2 * node, l, mid);build_segment_tree(2 * node + 1, mid + 1, r);seg_tree[node] = multiply(seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node)],seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node) + 1]);}}39 行未改动else{int mid = (l + r) / 2;// 计算左子树的余式vector<int> rem_left = poly_mod(rem, seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node)]);solve(2 * node, l, mid, rem_left);// 计算右子树的余式vector<int> rem_right = poly_mod(rem, seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node) + 1]);solve(2 * node + 1, mid + 1, r, rem_right);}}21 行未改动// 预处理阶乘precompute_factorials(max(n, max_k));// 初始化线段树seg_tree.reserve(4 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(m)); // 预留空间build_segment_tree(1, 0, m - 1);// 求解所有查询10 行未改动201 行未改动全部展开20220320420520620720820921021121239 行未改动25225325425525625725825926026126226326426521 行未改动28728828929029129229329429510 行未改动201 行未改动全部展开{int mid = (l + r) / 2;build_segment_tree(2 * node, l, mid);build_segment_tree(2 * node + 1, mid + 1, r);seg_tree[node] = multiply(seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node)],seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node) + 1]);}}39 行未改动else{int mid = (l + r) / 2;// 计算左子树的余式vector<int> rem_left = poly_mod(rem, seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node)]);solve(2 * node, l, mid, rem_left);// 计算右子树的余式vector<int> rem_right = poly_mod(rem, seg_tree[2 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(node) + 1]);solve(2 * node + 1, mid + 1, r, rem_right);}}21 行未改动// 预处理阶乘precompute_factorials(max(n, max_k));// 初始化线段树seg_tree.reserve(4 * static_cast<std::vector<std::vector<int, std::allocator<int>>,std::allocator<std::vector<int, std::allocator<int>>>>::size_type>(m)); // 预留空间build_segment_tree(1, 0, m - 1);// 求解所有查询10 行未改动