Cod sursa(job #3318928)

Utilizator mihaigeorgescuGeorgescu Mihai mihaigeorgescu Data 29 octombrie 2025 19:17:59
Problema Dtcsu Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <fstream>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;
ifstream fcin("dtcsu.in");
ofstream fout("dtcsu.out");
int x,q,rez;
vector <int> v;
signed main()
{
    for(int i=0; i<276997; i++)
        fcin>>x, v.emplace_back(x);
    sort(v.begin(), v.end());
    fcin>>q;
    while(q--)
    {
        fcin>>x;
        if(binary_search(v.begin(), v.end(), x))
            rez++;
    }
    fout<<rez;
    return 0;
}