Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <sstream>
- #include <algorithm>
- #include <vector>
- #include <stdlib.h>
- #include <stdio.h>
- #include <fstream>
- #include <stack>
- #include <map>
- #include <cstring>
- #include <cmath>
- #include <set>
- #include <iterator>
- #include <cmath>
- using namespace std;
- istream & operator >> (istream & in, vector<int> & v)
- {
- string str;
- getline(in,str);
- stringstream stream(str);
- int tmp;
- while(stream >> tmp)
- v.push_back(tmp);
- return in;
- }
- ostream & operator << (ostream & out, vector<int> const & v)
- {
- for(int el: v)
- out << el << ' ';
- return out;
- }
- int KolVoRod(map<string, string> Roditel, string el)
- {
- int k = -1;
- while (1 == 1)
- {
- if (Roditel.find(el) != Roditel.end()){
- el = Roditel[el];
- ++k;
- }
- else
- break;
- }
- return k;
- }
- int KolVoRod2ndTry(string str, map<string, string> d, int k)
- {
- if(d.find(str) == d.end())
- return k;
- else
- {
- ++k;
- return KolVoRod2ndTry(d[str], d, k);
- }
- }
- char CTL(char c)
- {
- int num;
- num = 'a' + int(c) - 'A';
- return (char)num;
- }
- string ToLower(string s)
- {
- int l, i;
- char c;
- l = s.size();
- for(i = 0; i != l ; ++i)
- {
- c = s[i];
- if ((int(c) <= int('Z')) && (int(c) >= int('A')))
- s[i] = CTL(c);
- }
- return s;
- }
- int main()
- {
- int N, j, a, i, tot;
- string answ, w;
- vector<string> inp, spw;
- cin >> N;
- tot = 0;
- map<string, set<string> > sl;
- for(i = 0; i < N; ++i)
- {
- cin >> w;
- sl[ToLower(w)].insert(w);
- }
- do{
- string n;
- cin >> n;
- if (sl.find(ToLower(n)) == sl.end())
- {
- a = 0;
- for(i = 0; i < n.size(); ++i)
- if ((n[i] >= 'A') && (n[i] <= 'Z'))
- a += 1;
- if(a != 1)
- tot += 1;
- }
- else
- if(sl[ToLower(n)].find(n) == sl[ToLower(n)].end())
- tot += 1;
- }while(getchar() == ' ');
- if (tot == 1) cout << 0;
- else
- cout << tot;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement