Cod sursa(job #3209210)

Utilizator tomaionutIDorando tomaionut Data 2 martie 2024 10:52:57
Problema Dtcsu Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");

unordered_map <long long, int> M;

int main()
{
    int i, x, q, sol = 0;
    for (i = 1; i <= 276997; i++)
    {
        fin >> x;
        M[x]++;
    }
    fin >> q;
    for (i = 1; i <= q; i++)
    {
        fin >> x;
        sol += (M[x] != 0);
    }
    fout << sol << "\n";

    return 0;
}