This documentation is automatically generated by competitive-verifier/competitive-verifier
#include "tools/upper_bound.hpp"
template <class ForwardIterator, class T>
typename ::std::iterator_traits<ForwardIterator>::difference_type upper_bound(ForwardIterator first, ForwardIterator last, T value);
It is identical to std::distance(first, std::upper_bound(first, last, value))
.
std::distance(first, std::upper_bound(first, last, value))
.#ifndef TOOLS_UPPER_BOUND_HPP
#define TOOLS_UPPER_BOUND_HPP
#include <iterator>
#include <algorithm>
namespace tools {
template <class ForwardIterator, class T>
auto upper_bound(ForwardIterator first, ForwardIterator last, const T& value) {
return ::std::distance(first, ::std::upper_bound(first, last, value));
}
template <class ForwardIterator, class T, class Compare>
auto upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp) {
return ::std::distance(first, ::std::upper_bound(first, last, value, comp));
}
}
#endif
#line 1 "tools/upper_bound.hpp"
#include <iterator>
#include <algorithm>
namespace tools {
template <class ForwardIterator, class T>
auto upper_bound(ForwardIterator first, ForwardIterator last, const T& value) {
return ::std::distance(first, ::std::upper_bound(first, last, value));
}
template <class ForwardIterator, class T, class Compare>
auto upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp) {
return ::std::distance(first, ::std::upper_bound(first, last, value, comp));
}
}