반응형
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /* Don't use name "pair" instead of "_pair" in class It will be collide std::pair in C++ */ template <typename T1, typename T2> class _pair { public: T1 first; T2 second; bool operator <(const _pair<T1, T2> &a) { if (first == a.first) return second < a.second; return first < a.first; } }; // This source code Copyright belongs to Crocus // If you want to see more? click here >> | Crocus |
반응형
'Applied > 자료구조' 카테고리의 다른 글
[STL] deque 구현 (2) | 2018.02.28 |
---|---|
[STL] list 구현 (2) | 2018.02.28 |
[STL] Vector 구현 (0) | 2018.01.26 |
트라이(Trie) 자료구조 (6) | 2017.10.18 |
SCC(Strongly Connected Component) (0) | 2017.07.21 |