complete 1764.cpp 10816.cpp 25793.kt

This commit is contained in:
2025-09-08 17:14:06 +09:00
parent f18ae8d149
commit 603f94f8d8
3 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
#include <iostream>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#include <iterator>
using namespace std;
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
int main() {
fastio();
int n, m;
cin >> n >> m;
auto = new set<string>();
auto = new set<string>();
for (auto i = 0; i < n; i++) {
string name;
cin >> name;
->insert(name);
}
for (auto j = 0; j < m; j++) {
string name;
cin >> name;
->insert(name);
}
auto = new vector<string>();
set_intersection(
->begin(), ->end(),
->begin(), ->end(),
back_inserter(*)
);
cout << ->size() << "\n";
for (auto name: *) {
cout << name << "\n";
}
delete ;
delete ;
delete ;
}