解决方法
尝试这个:
if (std::includes(set_one.begin(),set_one.end(),set_two.begin(),set_two.end())) { // ... }
The includes() algorithm compares two
sorted sequences and returns true if
every element in the range [start2,
finish2) is contained in the range
[start1,finish1). It returns false
otherwise. includes() assumes that the
sequences are sorted using
operator<(),or using the predicate
comp.
跑进来
At most ((finish1 – start1) + (finish2
– start2)) * 2 – 1 comparisons are performed.
Plus O(nlog(n))用于排序向量.你不会比它快得多.