Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cassert>
- #include <algorithm>
- #include <vector>
- #include <unordered_map>
- #include "optimization.h"
- #include <map>
- #define all(a) a.begin, a.end()
- using namespace std;
- int main() {
- int n = readInt();
- map<int, bool> used;
- for (int i = 0; i < n; i++){
- int temp = readInt();
- used[temp] = true;
- }
- int m = readInt();
- int count = 0;
- for (int i = 0; i < m; i++){
- int temp = readInt();
- if (used[temp]){
- count++;
- }
- }
- // cout << count;
- writeInt(count);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement