最大値とその位置
(functional/argmax.hpp)
- View this file on GitHub
- Last update: 2020-09-18 14:44:21+09:00
- Include:
#include "functional/argmax.hpp"
Code
#pragma once
#include<tuple>
/**
* @brief 最大値とその位置
*/
template<typename T,typename E>
struct argmax{
std::pair<T,E> operator()(const std::pair<T,E>& s,const std::pair<T,E>& t){
return s.second>=t.second?s:t;
}
};
#line 2 "functional/argmax.hpp"
#include<tuple>
/**
* @brief 最大値とその位置
*/
template<typename T,typename E>
struct argmax{
std::pair<T,E> operator()(const std::pair<T,E>& s,const std::pair<T,E>& t){
return s.second>=t.second?s:t;
}
};