hiho week 197 register

Ended

Participants:221

Verdict:Accepted
Score:100 / 100
Submitted:2018-04-08 19:47:15

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<stdio.h>
#include<string.h>
#include<iostream>
#include<cmath>
#include<string>
#include<set>
using namespace std;
const int maxn=100000+5;
set<string> s;
int main(){
    int n,cnt=0;
    string str;
    cin>>n;
    while(n--){
        cin>>str;
        s.insert(str);
    }
    set<string>::iterator it,it1;
    for(it=s.begin();it!=s.end();it++){
        str=(*it);
        int len=str.length();
        for(int i=0;i<len/2;i++){
            swap(str[i],str[len-1-i]);
        }
        it1=s.find(str);
        if(it1!=s.end()){
            cnt++;
        }
    }
    cout<<cnt/2<<endl;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX