diff options
Diffstat (limited to 'search/algos.hpp')
-rw-r--r-- | search/algos.hpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/search/algos.hpp b/search/algos.hpp index bb5c5d89cd..bfb4b2cc98 100644 --- a/search/algos.hpp +++ b/search/algos.hpp @@ -1,13 +1,13 @@ #pragma once -#include "base/base.hpp" -#include "std/algorithm.hpp" -#include "std/vector.hpp" +#include "base/base.hpp" +#include <algorithm> +#include <cstddef> +#include <vector> namespace search { - namespace impl { struct LS @@ -23,15 +23,15 @@ namespace impl increaseValue = 1; } }; -} +} // namespace impl -template <class T, class OutIterT, class CompT> -void LongestSubsequence(vector<T> const & in, OutIterT out, CompT cmp) +template <typename T, typename OutIterT, typename CompT> +void LongestSubsequence(std::vector<T> const & in, OutIterT out, CompT cmp) { if (in.empty()) return; - vector<impl::LS> v; + std::vector<impl::LS> v; v.reserve(in.size()); for (size_t i = 0; i < in.size(); ++i) v.push_back(impl::LS(i)); @@ -54,7 +54,7 @@ void LongestSubsequence(vector<T> const & in, OutIterT out, CompT cmp) v[j].prevDecreasePos = i; } - size_t const m = max(v[j].increaseValue, v[j].decreaseValue); + size_t const m = std::max(v[j].increaseValue, v[j].decreaseValue); if (m > res) { res = m; @@ -77,5 +77,4 @@ void LongestSubsequence(vector<T> const & in, OutIterT out, CompT cmp) pos = v[pos].prevDecreasePos; } } - -} +} // namespace search |