Pagini recente » Cod sursa (job #1843320) | Cod sursa (job #817332) | Cod sursa (job #1146011) | Cod sursa (job #816789) | Cod sursa (job #2795108)
#include <stdio.h>
#include <unordered_map>
#include <ctype.h>
#define CARDINAL 276997
using namespace std;
FILE *fin, *fout;
unordered_map<long long, bool> h;
long long readInt() {
long long n = 0;
char ch;
while(!isdigit(ch = fgetc(fin)));
do {
n = n * 10 + ch - '0';
}while(isdigit(ch = fgetc(fin)));
return n;
}
int main() {
long long n, i, ans;
long long x;
fin = fopen("dtcsu.in", "r");
for(i = 0; i < CARDINAL; i++) {
x = readInt();
h[x] = true;
}
n = readInt();
ans = 0;
for(i = 0; i < n; i++) {
x = readInt();
if(h[x] == true)
ans++;
}
fclose(fin);
fout = fopen("dtcsu.out", "w");
fprintf(fout, "%lld", ans);
fclose(fout);
return 0;
}