Cod sursa(job #3209211)

Utilizator tomaionutIDorando tomaionut Data 2 martie 2024 10:53:21
Problema Dtcsu Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.41 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];
    }
    fout << sol << "\n";

    return 0;
}