Advertisement
Guest User

Set_intersection

a guest
Mar 8th, 2023
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1.     ...
  2.     std::vector<int> v = {1, 2, 3, 4, 5};
  3.     std::vector<int> w = {2, 4, 6, 8, 10};
  4.     std::vector<int> x(v.size() + w.size());
  5.  
  6.     auto s = hpx::set_intersection(hpx::execution::par, v.begin(), v.end(), w.begin(), w.end(), x.begin());
  7.  
  8.     std::cout << "Common elements amount: " << std::distance(x.begin(), s) << std::endl;
  9.     ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement