You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#ifndef DUMMY_LIB_HPP
|
|
|
|
#define DUMMY_LIB_HPP
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
namespace performance_measuring {
|
|
|
|
|
|
|
|
int min_element_and_count(const std::vector<int>& 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<int>& v)
|
|
|
|
{
|
|
|
|
std::vector<int> 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
|