Pagini recente » Cod sursa (job #400238) | Cod sursa (job #1952006) | Cod sursa (job #732154) | Cod sursa (job #240346) | Cod sursa (job #1031959)
#include <fstream>
#include <algorithm>
using namespace std;
ifstream fin ("dtcsu.in");
ofstream fout ("dtcsu.out");
char s[100000000];
int v[200000000],x,n,i,m,a,ok,j,nr;
int main () {
n=0;
for (x=1;x<=276997;x++){
fin.get (s,1000000);
fin.get();
for(i=0;s[i]!=0;i++){
if(s[i]>='0'&&s[i]<='9')
x=x*10+s[i]-'0';
else {
v[++n]=x;
x=0;
}
}
v[++n]=x;
}
fin>>m;
for (i=1;i<=m;i++) {
fin>>a;
ok=0;
for (j=1;i<=n;j++ )
if (v[j]==a) {
ok=1;
break;
}
if (ok==1)
nr++;
}
fout<<nr;
return 0;
}