Cod sursa(job #3266794)
Utilizator | Data | 10 ianuarie 2025 15:58:05 | |
---|---|---|---|
Problema | Aprindere | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream cin("aprindere.in");
ofstream cout("aprindere.out");
int n, m, v[1001], a, b, c, d, s = 0;
cin >> n >> m;
for(int i = 0; i < n; i++)
cin >> v[i];
for(int i = 0; i < m; i++){
cin >> a >> b >> c;
for(int j = 0; j < c; j++){
cin >> d;
if(!v[d]){
s += c;
v[d] = 1;
}
}
}
cout << s;
return 0;
}