Advertisement
nani-desu-ka

Untitled

Dec 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <unordered_map>
  3. #include "optimization.h"
  4.  
  5. std::unordered_map <int, int> mapa;
  6. int main() {
  7.     std::ios_base::sync_with_stdio(false);
  8.     std::cin.tie(0);
  9.     std::cout.tie(0);
  10.     int input;
  11.     int value;
  12.     int amount;
  13.     std::cin >> amount;
  14.     for(int i = 0; i < amount; i++) {
  15.         std::cin >> input;
  16.         if (!mapa.count(input)) {
  17.             mapa[input] = 1;
  18.         }
  19.     }
  20.         int kek = 0;
  21.     std::cin >> amount;
  22.     for(int i = 0; i < amount; i++){
  23.         std::cin >> input;
  24.         if(mapa.count(input))
  25.             kek++;
  26.     }
  27.         std::cout << kek;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement