Cod sursa(job #2367446)

Utilizator mateibanuBanu Matei Costin mateibanu Data 5 martie 2019 10:48:13
Problema Dtcsu Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <bits/stdc++.h>

using namespace std;

#define ll long long

set<ll>s;
ll x,n,total,i;

int main()
{
    freopen("dtcsu.in","r",stdin);
    freopen("dtcsu.out","w",stdout);
    for (i=1;i<=276997;i++){
        scanf("%lld",&x);
        s.insert(x);
    }
    scanf("%lld",&n);
    while (n){
        n--;
        scanf("%lld",&x);
        if (s.count(x)!=0){
            total++;
        }
    }
    printf("%lld",total);
    return 0;
}