-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1764.cpp
More file actions
32 lines (29 loc) · 698 Bytes
/
1764.cpp
File metadata and controls
32 lines (29 loc) · 698 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
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
vector<string> hear;
vector<string> see;
int hearnum;
int seenum;
string input;
cin >> hearnum;
cin >> seenum;
for (int i = 0; i < hearnum; i++) {
cin >> input;
hear.push_back(input);
}
for (int i = 0; i < seenum; i++) {
cin >> input;
if (find(hear.begin(), hear.end(), input) != hear.end())
see.push_back(input);
}
sort(see.begin(), see.end());
printf("%d\n", (int)see.size());
for (int i = 0; i < see.size(); i++) {
printf("%s\n", see.at(i).c_str());
}
return (0);
}