competitive-programing

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub Astral-23/competitive-programing

:warning: Others/mypair.hpp

Code

template<typename T1, typename T2>
struct MYPAIR {
	T1 FIRST_V; 
	T2 SECOND_V;
	MYPAIR () {}
	MYPAIR (T1 _FIRST_V, T2 _SECOND_V) : FIRST_V(_FIRST_V), SECOND_V(_SECOND_V) {}
	bool operator<(const MYPAIR& a) {
		if(FIRST_V != a.FIRST_V) return FIRST_V < a.FIRST_V;
		else return SECOND_V < a.SECOND_V;
	}
	bool operator>(const MYPAIR& a) {
		if(FIRST_V != a.FIRST_V) return FIRST_V > a.FIRST_V;
		else return SECOND_V > a.SECOND_V;
	}
	bool operator==(const MYPAIR& a) {
		return (FIRST_V==a.FIRST_V) && (SECOND_V == a.SECOND_V);
	}
	bool operator!=(const MYPAIR& a) {
		return !(*this == a);
	}
}; 

/*
@ brief 自作のpair
*/
#line 1 "Others/mypair.hpp"
template<typename T1, typename T2>
struct MYPAIR {
	T1 FIRST_V; 
	T2 SECOND_V;
	MYPAIR () {}
	MYPAIR (T1 _FIRST_V, T2 _SECOND_V) : FIRST_V(_FIRST_V), SECOND_V(_SECOND_V) {}
	bool operator<(const MYPAIR& a) {
		if(FIRST_V != a.FIRST_V) return FIRST_V < a.FIRST_V;
		else return SECOND_V < a.SECOND_V;
	}
	bool operator>(const MYPAIR& a) {
		if(FIRST_V != a.FIRST_V) return FIRST_V > a.FIRST_V;
		else return SECOND_V > a.SECOND_V;
	}
	bool operator==(const MYPAIR& a) {
		return (FIRST_V==a.FIRST_V) && (SECOND_V == a.SECOND_V);
	}
	bool operator!=(const MYPAIR& a) {
		return !(*this == a);
	}
}; 

/*
@ brief 自作のpair
*/
Back to top page