From d541c3c2e303a4bc4bd7bab99b0d5a1f53660fe5 Mon Sep 17 00:00:00 2001 From: shogo314 <80336945+shogo314@users.noreply.github.com> Date: Tue, 13 Aug 2024 01:24:17 +0900 Subject: [PATCH] size_t -> std::size_t --- cpp/rerooting-dp.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/rerooting-dp.hpp b/cpp/rerooting-dp.hpp index 1a501f3..d9200ee 100644 --- a/cpp/rerooting-dp.hpp +++ b/cpp/rerooting-dp.hpp @@ -5,6 +5,7 @@ * @brief 全方位木DP */ #include +#include #include #include "tree.hpp" @@ -40,12 +41,12 @@ std::vector rerooting_dp(const Tree& tree, E e, Merge merge, AddEdge ad for (int u : rooted.preorder) { const auto& ch = rooted.child[u]; std::vector ri(ch.size() + 1, e); - for (size_t i = ch.size(); i > 0; i--) { + for (std::size_t i = ch.size(); i > 0; i--) { ri[i - 1] = merge(ri[i], addedge(subdp[ch[i - 1].dst], ch[i - 1].cost, ch[i - 1].id)); } dp[u] = addnode(merge(pe[u], ri[0]), u); E le = pe[u]; - for (size_t i = 0; i < ch.size(); i++) { + for (std::size_t i = 0; i < ch.size(); i++) { pe[ch[i].dst] = addedge(addnode(merge(le, ri[i + 1]), u), ch[i].cost, ch[i].id); le = merge(le, addedge(subdp[ch[i].dst], ch[i].cost, ch[i].id)); }