Cod sursa(job #3177457)
| Utilizator | Data | 29 noiembrie 2023 10:49:22 | |
|---|---|---|---|
| Problema | Dtcsu | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ifstream fin("dtcsu.in");
ofstream fout("dtcsu.out");
#define HASH_BASE 73
#define HASH_SIZE 1000007
int computehash(int x)
{
int strhash=0;
while(x)
{
strhash = (strhash * HASH_BASE + x%10)%HASH_SIZE;
x/=10;
}
return strhash;
}
unordered_set<ll> S;
int main()
{
for(int i=1;i<=276997;i++)
{
ll x;
fin >> x;
S.insert(x);
}
int q;
fin >> q;
while(q--)
{
int x;
fin >> x;
cnt += S.count(x);
}
fout << cnt;
}
