From 9d8846441126b18eb7f521c04442b152c59bb41c Mon Sep 17 00:00:00 2001 From: Kohei Morita Date: Sun, 12 Nov 2023 20:28:00 +0900 Subject: [PATCH] fix for gcc13 --- .../range_chmin_chmax_add_range_sum/sol/correct.cpp | 2 ++ .../sol/correct_with_assert.cpp | 2 ++ graph/min_cost_b_flow/sol/correct.cpp | 1 + graph/min_cost_b_flow/sol/ssp.cpp | 1 + .../sol/correct.cpp | 4 +++- math/composition_of_formal_power_series/sol/naive.cpp | 11 ++++++----- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/datastructure/range_chmin_chmax_add_range_sum/sol/correct.cpp b/datastructure/range_chmin_chmax_add_range_sum/sol/correct.cpp index ba7b2b2a9..01e33bb93 100644 --- a/datastructure/range_chmin_chmax_add_range_sum/sol/correct.cpp +++ b/datastructure/range_chmin_chmax_add_range_sum/sol/correct.cpp @@ -3,6 +3,8 @@ #include #include #include +#include + #define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i)) #define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i)) #define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i)) diff --git a/datastructure/range_chmin_chmax_add_range_sum/sol/correct_with_assert.cpp b/datastructure/range_chmin_chmax_add_range_sum/sol/correct_with_assert.cpp index 7f9bf014d..713de85a4 100644 --- a/datastructure/range_chmin_chmax_add_range_sum/sol/correct_with_assert.cpp +++ b/datastructure/range_chmin_chmax_add_range_sum/sol/correct_with_assert.cpp @@ -2,6 +2,8 @@ #include #include #include +#include + #define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i)) #define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i)) #define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i)) diff --git a/graph/min_cost_b_flow/sol/correct.cpp b/graph/min_cost_b_flow/sol/correct.cpp index ad457a053..ac78db0c0 100644 --- a/graph/min_cost_b_flow/sol/correct.cpp +++ b/graph/min_cost_b_flow/sol/correct.cpp @@ -7,6 +7,7 @@ #include #include #include +#include enum Objective { MINIMIZE = 1, diff --git a/graph/min_cost_b_flow/sol/ssp.cpp b/graph/min_cost_b_flow/sol/ssp.cpp index 958d2c30c..868cd4d79 100644 --- a/graph/min_cost_b_flow/sol/ssp.cpp +++ b/graph/min_cost_b_flow/sol/ssp.cpp @@ -6,6 +6,7 @@ #include #include #include +#include enum Objective { MINIMIZE = 1, diff --git a/graph/vertex_add_range_contour_sum_on_tree/sol/correct.cpp b/graph/vertex_add_range_contour_sum_on_tree/sol/correct.cpp index 5d6747cf5..5b4ee3261 100644 --- a/graph/vertex_add_range_contour_sum_on_tree/sol/correct.cpp +++ b/graph/vertex_add_range_contour_sum_on_tree/sol/correct.cpp @@ -16,7 +16,9 @@ struct SegmentTree { SegmentTree() : SegmentTree(0) {} SegmentTree(int n) : _n(n), _seg(2 * n, e()) {} SegmentTree(const std::vector &a) : _n(a.size()), _seg(2 * _n) { - std::copy(a.begin(), a.end(), _seg.begin() + _n); + for (int i = 0; i < _n; i++) { + _seg[_n + i] = a[i]; + } for (int i = _n - 1; i > 0; --i) { _seg[i] = op(_seg[2 * i + 0], _seg[2 * i + 1]); } diff --git a/math/composition_of_formal_power_series/sol/naive.cpp b/math/composition_of_formal_power_series/sol/naive.cpp index d02bb2f3e..1338d21f1 100644 --- a/math/composition_of_formal_power_series/sol/naive.cpp +++ b/math/composition_of_formal_power_series/sol/naive.cpp @@ -1,8 +1,9 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define MOD 998244353LL using namespace::std;