struct cmp{
bool operator()(const Class &a, const Class &b) const{
return a.x > b.x;
}
};
int main()
{
list<Class> reqs = ReadFile();
priority_queue < Class, vector<Class>, cmp > q;
{
q.push(*it);
}
unordered_multimap < string, Class> map;
while (!q.empty())
{
bool isOverlap = false;
auto cur = q.top();
q.pop();
for (auto loc : cur.y)
{
string key = loc;
int n = map.count(key);
if (map.find(key) != map.end())
{
auto it = map.lower_bound(key);
for (; it != map.upper_bound(key); ++it)
{
//overlapped
if (it->second._endT > cur._startT)
{
rmvReqs.push_back(cur);
isOverlap = true;
break;
}
}
if (it == map.upper_bound(key))
map.insert(make_pair(key, cur));
}
else
{
map.insert(make_pair(key, cur));
}
}
if (!isOverlap) validReq.push_back(cur);
}
return 0;
}