
#include <hash_map>
#include <cstdio>
#include <iostream>
using namespace std;
using namespace __gnu_cxx;
const int NODE_HASH = 13333331;
struct Node{
int a, b;
};
struct Node_hash{
size_t operator()(const Node& rhs) const {
return rhs.a * rhs.b % NODE_HASH;
}
};
///回傳值型別為size_t
struct Node_equal{
bool operator()(const Node &x, const Node &y) const {
return x.a == y.a && x.b == y.b;
}
};
int main()
{
hash_map<Node, int, Node_hash, Node_equal> hmp;
return 0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/243418.html
標籤:C++ 語言
下一篇:請教演算法筆記上一個基礎問題!
