1234567891011121314151617181920212223242526const int MAXhx = 100237;const int B1 = 1007;const int B2 = 10009;struct Hx { vector<pair<Ele, int>> a[MAXhx + 10]; void Init() { for (int i = 0; i < MAXhx; ++i) { a[i].clear(); a[i].shrink_to_fit(); } } inline int& operator[](Ele v) { int hxidx = (v.x * B1 % MAXhx + v.y * B2 % MAXhx) % MAXhx; int i, topi = a[hxidx].size(); for (i = 0; i < topi; ++i) { if (a[hxidx][i].first == v) { break; } } if (i < topi) return a[hxidx][i].second; else { a[hxidx].push_back(make_pair(v, 0)); return a[hxidx][topi].second; } }};