This documentation is automatically generated by competitive-verifier/competitive-verifier
#include "tools/greater_by_first.hpp"
It compares two pairs by the first element.
std::vector<std::pair<int, int>> a;
std::sort(a.begin(), a.end(), tools::greater_by_first());
tools::greater_by_first 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.first > y.first
.
Otherwise, it returns false
.
#ifndef TOOLS_GREATER_BY_FIRST_HPP
#define TOOLS_GREATER_BY_FIRST_HPP
#include <utility>
namespace tools {
class greater_by_first {
public:
template <class T1, class T2>
bool operator()(const ::std::pair<T1, T2>& x, const ::std::pair<T1, T2>& y) const {
return x.first > y.first;
}
};
}
#endif
#line 1 "tools/greater_by_first.hpp"
#include <utility>
namespace tools {
class greater_by_first {
public:
template <class T1, class T2>
bool operator()(const ::std::pair<T1, T2>& x, const ::std::pair<T1, T2>& y) const {
return x.first > y.first;
}
};
}