Cod sursa(job #1016365)

Utilizator VmanDuta Vlad Vman Data 26 octombrie 2013 09:27:55
Problema Dtcsu Scor Ascuns
Compilator cpp Status done
Runda Marime 0.46 kb
#include <cstdio>
#include <set>
using namespace std;

long long X;
int Q;
set<long long> H;

int main() {
    freopen("dtcsu.in","r", stdin);
    freopen("dtcsu.out", "w", stdout);
    
    for (int i=0; i<276997; ++i) {
        scanf("%lld", &X);
        H.insert(X);
    }
    
    scanf("%d", &Q);
    int total = 0;
    for (int i=0; i<Q; ++i) {
        scanf("%lld", &X);
        if (H.find(X) != H.end()) ++total;
    }
    printf("%d\n", total);
    
    return 0;
}