#include <unordered_set>
#include <iostream>
#include <string>
#include <list>
struct Interval {
unsigned int b;
unsigned int e;
bool updated;
int patternIndex;
int proteinIndex;
std::string getID() const { return std::to_string(b) + " " + std::to_string(e) + " " + std::to_string(proteinIndex); }
};
int main() {
auto hash = [](const Interval& i){ return std::hash<std::string>()(i.getID()); };
auto equal = [](const Interval& i1, const Interval& i2){ return i1.getID() == i2.getID(); };
std::unordered_set<Interval, decltype(hash), decltype(equal)> test(8, hash, equal);
std::list<Interval> concat { {1, 2, false, 3, 4}, {2, 3, false, 4, 5}, {1, 2, true, 7, 4}};
for (auto const &i : concat)
test.insert(i);
for (auto const &i : test)
std::cout << i.b << ", " << i.e << ", " << i.updated << std::endl;
return 0;
}
ICAgICNpbmNsdWRlIDx1bm9yZGVyZWRfc2V0PgogICAgI2luY2x1ZGUgPGlvc3RyZWFtPgogICAgI2luY2x1ZGUgPHN0cmluZz4KICAgICNpbmNsdWRlIDxsaXN0PgogICAgIAogICAgc3RydWN0IEludGVydmFsIHsKICAgICAgICB1bnNpZ25lZCBpbnQgYjsKICAgICAgICB1bnNpZ25lZCBpbnQgZTsKICAgICAgICBib29sIHVwZGF0ZWQ7CiAgICAgICAgaW50IHBhdHRlcm5JbmRleDsKICAgICAgICBpbnQgcHJvdGVpbkluZGV4OwogICAgICAgIHN0ZDo6c3RyaW5nIGdldElEKCkgY29uc3QgeyByZXR1cm4gc3RkOjp0b19zdHJpbmcoYikgKyAiICIgKyBzdGQ6OnRvX3N0cmluZyhlKSArICIgIiArIHN0ZDo6dG9fc3RyaW5nKHByb3RlaW5JbmRleCk7IH0KICAgIH07CiAgICAgCiAgICBpbnQgbWFpbigpIHsKICAgICAgICBhdXRvIGhhc2ggPSBbXShjb25zdCBJbnRlcnZhbCYgaSl7IHJldHVybiBzdGQ6Omhhc2g8c3RkOjpzdHJpbmc+KCkoaS5nZXRJRCgpKTsgfTsKICAgICAgICBhdXRvIGVxdWFsID0gW10oY29uc3QgSW50ZXJ2YWwmIGkxLC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