Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- set <string> S;
- int main() {
- ifstream in ("input.txt");
- ofstream out ("output.txt");
- int N;
- in >> N;
- int sol = 0;
- for (int i=0; i<N; i++) {
- string a, b, c;
- string op1, op2;
- in >> a >> op1 >> b >> op2 >> c;
- S.insert (a);
- if (S.count(b)==0 && S.count(c)==0) sol++;
- }
- out << sol;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement