Cod sursa(job #1032295)

Utilizator impulseBagu Alexandru impulse Data 15 noiembrie 2013 19:13:00
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda FMI No Stress 4 Marime 0.61 kb
#include <fstream>
#include <set>
#include <stdio.h>
using namespace std;

#define file_in "dtcsu.in"
#define file_out "dtcsu.out", "w"

typedef unsigned long long int uLONG;

set<uLONG> h;
typedef set<uLONG>::iterator it;

int main()
{
    ifstream fin(file_in);
    FILE* _out = fopen(file_out);
    int q, w, x, c = 0;
    for(int i = 0; i < 276997; i++)
    {
        fin>>x;
        h.insert(x);
    }
    fin>>q;
    it e = h.end();
    for(int i = 0; i < q; i++)
    {
        fin>>w;
        if(h.find(w) != e)
            c++;
    }
    fprintf(_out, "%d \n", c);
    return 0;
}