-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFACEFRND.cpp
More file actions
41 lines (37 loc) · 738 Bytes
/
FACEFRND.cpp
File metadata and controls
41 lines (37 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int main() {
int num,i,j;
cin >> num;
int arr[num][100];
set <int> s;
set <int> k;
for(i=0;i<num;i++)
{
cin >> arr[i][0];
s.insert(arr[i][0]);
cin >> arr[i][1];
for(j=2;j<arr[i][1]+2;j++)
{
cin >> arr[i][j];
}
}
for(i=0;i<num;i++)
{
for(j=2;j<arr[i][1]+2;j++)
{
if(s.find(arr[i][j])==s.end())
{
k.insert(arr[i][j]);
s.insert(arr[i][j]);
}
}
}
cout << k.size();
return 0;
}