hiho week 197 register

Ended

Participants:221

Verdict:Accepted
Score:100 / 100
Submitted:2018-04-08 09:53:57

Lang:G++

Edit
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
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<set>
using namespace std;
int main() {
    int n;
    cin >> n;
    set<string> s;
    int count = 0;
    string str;
    for (int i = 0; i < n; i++) {
        cin >> str;
        if (s.find(str) != s.end()){
            count++;
            continue;
        }
        s.insert(str);
        reverse(str.begin(), str.end());
        if (s.find(str) == s.end())
            s.insert(str);
        else
            count++;
    
    }
    cout << count << endl;
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX