#ifndef DUMMY_LIB_HPP #define DUMMY_LIB_HPP #include #include namespace performance_measuring { int count_on_the_way(const std::vector& v) { int min = v[0]; int c = 1; for (int i = 1; i < v.size(); ++i) { if (v[i] > min) { continue; } if (v[i] == min) { ++c; } else { min = v[i]; c = 1; } } return c; } int min_element_and_count(const std::vector& v) { int min = *std::min_element(v.begin(), v.end()); return std::count(v.begin(), v.end(), min); } int sort_and_upper_bound(const std::vector& v) { std::vector tmp(v); std::sort(tmp.begin(), tmp.end()); const auto p = std::upper_bound(tmp.begin(), tmp.end(), *tmp.begin()); return std::distance(tmp.begin(), p); } } #endif