This documentation is automatically generated by competitive-verifier/competitive-verifier
#include "tools/less_by_second.hpp"
It compares two pairs by the second element.
std::vector<std::pair<int, int>> a;
std::sort(a.begin(), a.end(), tools::less_by_second());
tools::less_by_second comp();
It creates a comparator.
template <typename T1, typename T2>
bool comp(std::pair<T1, T2> x, std::pair<T1, T2> y);
It returns true
if x.second < y.second
.
Otherwise, it returns false
.
#ifndef TOOLS_LESS_BY_SECOND_HPP
#define TOOLS_LESS_BY_SECOND_HPP
#include <utility>
namespace tools {
class less_by_second {
public:
template <class T1, class T2>
bool operator()(const ::std::pair<T1, T2>& x, const ::std::pair<T1, T2>& y) const {
return x.second < y.second;
}
};
}
#endif
#line 1 "tools/less_by_second.hpp"
#include <utility>
namespace tools {
class less_by_second {
public:
template <class T1, class T2>
bool operator()(const ::std::pair<T1, T2>& x, const ::std::pair<T1, T2>& y) const {
return x.second < y.second;
}
};
}