Advertisement
kolbka_

Untitled

Dec 16th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include <iostream>
  5. #include <cassert>
  6. #include <algorithm>
  7. #include <vector>
  8. #include <unordered_map>
  9. #include "optimization.h"
  10. #include <map>
  11.  
  12. #define all(a) a.begin, a.end()
  13. using namespace std;
  14.  
  15. int main() {
  16. int n = readInt();
  17.  
  18. map<int, bool> used;
  19. for (int i = 0; i < n; i++){
  20. int temp = readInt();
  21. used[temp] = true;
  22. }
  23. int m = readInt();
  24. int count = 0;
  25. for (int i = 0; i < m; i++){
  26. int temp = readInt();
  27. if (used[temp]){
  28. count++;
  29. }
  30. }
  31. // cout << count;
  32. writeInt(count);
  33. }
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement