Pagini recente » Cod sursa (job #2328238) | Cod sursa (job #2249446) | Cod sursa (job #2901736) | Cod sursa (job #829966) | Cod sursa (job #1035601)
#include <fstream>
#include <algorithm>
#define in "dtcsu.in"
#define out "dtcsu.out"
#define Max_Size 13000
#define LL long long
std :: ifstream f(in);
std :: ofstream g(out);
LL V[Max_Size];
int Q;
LL x;
inline void Read_Data()
{
for(int i = 1; i <= 12904; ++i) f >> V[i];
f >> Q;
}
inline void Solve()
{
int sol = 0;
while(Q--)
{
f >> x;
int pos = std :: lower_bound(V + 1, V + 12904 + 1, x) - V;
if(pos >= 1 && pos <= 12904 && V[pos] == x) ++sol;
}
g << sol << '\n';
}
int main()
{
Read_Data();
std :: sort(V + 1, V + 12904 + 1);
Solve();
}