Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <set>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- string trash;
- getline(cin, trash);
- set<string> names;
- string magaz;
- int k = 0;
- for (int i = 0; i < n; i++)
- {
- getline(cin, magaz);
- if (names.find(magaz) != names.end())
- {
- k++;
- }
- else
- {
- names.insert(magaz);
- }
- }
- cout << k << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement