Pagini recente » Istoria paginii runda/pre_oni_gim2015 | Cod sursa (job #2247200) | Profil MarinPeptenaru | Cod sursa (job #2056528) | Cod sursa (job #2001925)
#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;
}