Cod sursa(job #2001925)

Utilizator sergiudnyTritean Sergiu sergiudny Data 18 iulie 2017 01:41:53
Problema Dtcsu Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.84 kb
#include <bits/stdc++.h>
#define ull unsigned long long
#define number 276997
using namespace std;

FILE *_fin = fopen("dtcsu.in","r");
ofstream fout("dtcsu.out");
int _in_loc; char _in_buff[4096];
char read_ch()
{
    ++_in_loc;
    if (_in_loc == 4096) {
        _in_loc = 0;
        fread(_in_buff, 1, 4096, _fin);
    }
    return _in_buff[_in_loc];
}
ull read(){
    ull u64 = 0; char c;
    while (!isdigit(c = read_ch()) && c != '-');
    long long sgn = 1;
    u64 = c - '0';
    while (isdigit(c = read_ch()))
        u64 = u64 * 10 + c - '0';
    return u64;
}

ull x,q,sol;
set<ull>s;
int main()
{
    for(int i=1;i<=number;++i){
        x = read();
        s.insert(x);
    }
    q = read();
    while(q--){
        x = read();
        if(s.find(x)!=s.end())sol++;
    }
    fout<<sol;
    return 0;
}