Pagini recente » Cod sursa (job #1353424) | Cod sursa (job #956717) | Cod sursa (job #1072984) | Cod sursa (job #2465206) | Cod sursa (job #3278147)
#include <bits/stdc++.h>
std::ifstream fin("dtcsu.in");
std::ofstream fout("dtcsu.out");
const int rows = 276997;
const int mod = 99013;
int queries;
int64_t x;
std::vector<int64_t> hash[mod];
int main()
{
std::ios_base::sync_with_stdio(false);
fin.tie(nullptr);
for(int i = 1; i <= rows; ++i)
{
fin >> x;
hash[x % mod].emplace_back(x);
}
fin >> queries;
int count = 0;
for(int k = 1; k <= n; ++k)
{
fin >> x;
if(x >= 1)
{
for(auto value : hash[x % mod])
if(value == x)
{
count++;
break;
}
}
}
fout << count;
return 0;
}