Cod sursa(job #2300351)

Utilizator sandupetrascoPetrasco Sandu sandupetrasco Data 11 decembrie 2018 11:00:30
Problema Dtcsu Scor 0
Compilator cpp-32 Status done
Runda Arhiva de probleme Marime 0.47 kb
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define MOD 666013
using namespace std;
typedef long long ll;
typedef pair< ll , ll > PII;
 
int n, q, rs;
ll x;
unordered_map < ll, bool > M;
 
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
 
    ifstream cin("dtcsu.in");
    ofstream cout("dtcsu.out");

	for (int i = 1; i <= 276997; i++) {
		cin >> x;
		M[x] = 1; 
	}

	cin >> q;
	while (q--) {
		cin >> x;
		rs += M[x];
	}

	cout << rs;
	return 0;
}